What You Can Do with Mathcad

Mathcad combines the live document interface of a spreadsheet with the WYSIWYG interface of a word processor. In addition, Mathcad’s computational abilities range from adding up a column of numbers to evaluating integrals and derivatives, solving systems of equations and more.

You can place equations, text, and graphics anywhere in your worksheet. The equations are WYSIWYG and live. That is, equations appear as you're used to seeing them on blackboards or in reference books, and as soon as you make a change anywhere in your worksheet, Mathcad updates results and redraws graphs. This makes it easy keep track of the most complex calculations.

After creating a presentation-quality document, you can share your work with others by printing the worksheet exactly as it appears on the screen, emailing it, or posting it on the web.


The Mathcad Desktop

When you start Mathcad, you will see:

A new worksheet

The Menu bar

The Math toolbar

The Standard toolbar

The Formatting toolbar

You can show or hide these and other toolbars using the View menu options. You can also move them around your window. When you exit and re-open Mathcad, the elements are positioned as they were when you exited.


Your Worksheet

A worksheet is a collection of equations, text, graphics, and other items. Each equation, piece of text, graphic, or other item that you insert into your worksheet is a "region." An invisible rectangle holds each region. To see the regions, choose Regions from the View menu.

To start a new region:

  1. Click in blank space. This leaves a small crosshair wherever you clicked the mouse.

  2. Then type an equation, insert text, create a graph, etc.

As you insert various equations, text and graphics into a worksheet, you can arrange them and format them however you like.


Tutorials, QuickSheets, and Reference Tables

The Resources toolbar provides Tutorials, QuickSheets, and Reference Tables in Electronic Book form. Tutorials include basic primers, more in-depth features, and some advanced topics. The QuickSheets are live examples of many of Mathcad functions and programs you can use in your own work. Reference Tables contain useful mathematical formulae and constants. All three are also available from the Help menu.

Once you open one of these electronic books, click on any topic to open it and use the arrow buttons on the toolbar to browse through it.


Printing a Worksheet

To print the worksheet:

  1. Choose Print from the File menu to bring up the Print dialog box.

  2. Click "OK."

Before printing, you may want to see how your worksheet will look by choosing Print Preview from the File Menu.


Saving a Worksheet

To save a worksheet:

  1. Choose Save from the File menu. This replaces the old copy of the worksheet.

To save the worksheet without replacing the old copy:

  1. Choose Save As from the File menu.

  2. Save the worksheet under a different name.

You can also use Save As to save a worksheet as an RTF file, an HTML file, or as a worksheet compatible with earlier versions through the Save as Type drop down list.

Note:

If you use Microsoft SharePoint to manage your Mathcad worksheets, you can save files directly to your Document Library.


Entering Equations

To build mathematical expressions, you simply need to position the crosshair in your worksheet and begin typing letters, numbers or operators such as + or - .

  • When typing letters or numbers, you’ll see them appear surrounded by editing lines which show you which characters are selected. Use Space and the arrow keys to select various parts of an expression.

  • You can insert operators by clicking on the appropriate button in the operator toolbars or by pressing the keystroke for the operator.

Follow these steps to build the expression [image] and see how the numbers, editing lines, and operators work together:

  1. Type a.

  2. Type [Shift] 6 which is the keystroke for exponential operator.

  3. Type 2 in the placeholder that appears.

  4. Type the + on your keyboard for the addition operator and type b in the placeholder.

  5. Press Space twice to make the editing lines hold the entire expression.

  6. Type the + on your keyboard and type y in the placeholder.

The worksheet automatically assembles an expression using the rules of precedence and some additional rules that simplify entering denominators, exponents, and expressions in radicals. For example, anything you type is placed beside whatever is enclosed in the editing lines.


Evaluating an Expression

Although sophisticated mathematics can be perform, you can just as easily use it as a simple calculator. To make a simple numerical calculation:

  1. Click anywhere in your worksheet and type the expression you want to evaluate.

  2. Press "=".

Make sure any variables you use in the expression to the left of the equals sign are not marked in red.

You can also evaluate expressions symbolically.


Using Range Variables to Evaluate Expressions

Evaluating an Expression Over a Range

Use range variables to repeatedly evaluate an expression over a range of values as shown below. The worksheet evaluates the expression once for each value of the range variable.

If you use two or more range variables in an equation, the worksheet evaluates the equation once for each value of each range variable. This is useful when defining matrices:


Defining a Variable

Before you can evaluate an expression involving a variable rather than a constant, you must define the variable. To do so:

  1. Type the variable name.

  2. Type ":" to see the definition symbol, ":=" and a placeholder.

  3. Type a number, an expression, or a string in the placeholder.

If you type an expression in the placeholder, make sure any variables or functions you use in that expression are not undefined variables marked in red.

Launch QuickSheet Example


Defining a Function

A function is a rule which performs certain operations to its arguments and returns a numerical result. To define a function:

  1. Type the function name followed by a left parenthesis.

  2. Type a list of arguments separated by commas followed by a right parenthesis.

  3. Type ":" to see the definition symbol, ":=" and a placeholder.

  4. Type an expression or a string in the placeholder.

Make sure any variables you use in right-hand expression are either

  • defined beforehand, or

  • part of the argument list.

If a variable in the right-hand expression doesn't satisfy one of these conditions, you'll see it marked in red as undefined.

When you've defined a function, the function is not evaluated it until you use it later on in the worksheet.

Launch QuickSheet Example


Entering Variable and Function Names

Variable and function names can be any length and can contain a variety of characters. There are, however, some restrictions:

  • Characters allowed in variable and function names...

  • Restrictions on variable and function names...

  • Typing a name containing operators

  • Typing a name containing symbols


Predefined Constants

Predefined Math Constants

Name | Keystroke
 | Ctrl+Shift+z
e | e
 | Ctrl+Shift+p
i | 1i
j | 1j
% | %

To redefine math constants...

Predefined System Constants

Name | Default Value
TOL | .001
CTOL | .001
ORIGIN | 1
PRNPRECISION | 4
PRNCOLWIDTH | 8
CWD | current working directory in the form of a string

To redefine system constants...


Entering and displaying numbers

Entering Numbers

Anything beginning with a digit is interpreted as a number by your worksheet. As a general rule, you enter numbers by simply typing the digits from the keyboard, using a period as the decimal point. Click on any of the following topics to learn about special rules applicable to that topic:

  • Numbers > 999

  • Exponential notation

  • Imaginary numbers

  • Complex numbers

  • Numbers to other bases


Editing Cursor

The editing cursor takes on the three different forms shown below. Click on any picture below to learn what that cursor is for and how to get it.

Crosshair

Text insertion point

Editing lines

Don't confuse this with the "pointer". The pointer is used to place the cursor. Which of the above three forms the cursor takes will depend on what the pointer is pointing at when you click the mouse.


Changing a Name or Number

There are two ways to do this. If you have just a few characters to change...

  1. Click in the name or number. Use the left or right arrow keys to move the insertion line if necessary.

  2. Type letters and numbers. To delete a character just behind the insertion line, press BkSp.

...or if you prefer to just start over:

  1. Click in the name or number. If necessary, press Space to enclose the entire name or number between the editing lines.

  2. Choose Cut from the Edit menu. This deletes the name or number and leaves behind a placeholder.

  3. Click in the placeholder and type the new name or number.


Inserting an Operator

To insert an operator, remember that whatever is between editing lines becomes the first operand of the next operator you type. So to insert an operator:

  1. Place between the editing lines whatever you want as the operand. Press Space if necessary to lengthen the editing lines.

  2. Type the keystroke for the operator.

  3. To insert an operator before the selected expression, press Ins before typing the operator.

To insert an operator into an operator placeholder (what you see after you delete an operator in a complicated expression), place the vertical editing line before or after the operator placeholder and type the keystroke for the operator.


Deleting an Operator

To delete an operator:

  1. Place the insertion line between the operand and the operator.

  2. Press either BkSp or Delete, depending on whether the operator is to the left or right of the vertical insertion line.

For more complicated expressions, an operator placeholder appears after you delete an operator. For example, the subtraction operator was deleted in the following expression:

Type the keystroke for a new operator to replace the deleted one. For example:

Note: In complicated expressions, such as the one above, you cannot delete the operator placeholder. You must fill it in with an operator. In other cases, such as when the operator placeholder is between to simple numbers, you can delete the operator placeholder.


Inserting Parentheses

It's usually much easier to insert a pair of parentheses using the following procedure:

  1. Enclose the expression between the editing lines

  2. Press the apostrophe (') to insert parentheses.

This is much easier than trying to insert parentheses one at a time as you would with a word processor.


Deleting Parentheses

To delete a pair of parentheses:

  1. Move the insertion line to the right of the "(".

  2. Press BkSp.

You cannot delete one parenthesis at a time. Whenever you delete one, you automatically delete the other.


Inserting a Minus Sign

The procedure below inserts the minus sign that negates a number.

  1. Click in the expression and press Space if necessary to place it between editing lines.

  2. Press Ins to put the vertical arm on the left side.

  3. Press the minus sign.


Deleting a Minus Sign

The procedure below deletes the minus sign that negates a number.

  1. Click in the expression and press Space if necessary to place it between the editing lines.

  2. Press Ins to move the insertion line to the left.

  3. Press BkSp.


Applying a Function to an Expression

Use the following procedure when you want to make an expression the argument to a function:

  1. Click in the expression and press Space until the entire expression is between the editing lines.

  2. Press the apostrophe (') to place parentheses around the expression.

  3. Press Space to enclose the parentheses between the editing lines.

  4. Press Ins to move the vertical arm to the left.

  5. Type the function name.


Moving Parts of an Expression

Use the following procedure to move part of an expression to either an empty placeholder or to a blank space in your worksheet.

  1. Place the expression you want to move between the editing lines.

  2. Choose Cut or Copy from the Edit menu.

  3. Click in an empty space or on the placeholder into which you want to paste the selected expression.

  4. Choose Paste from the Edit menu paste the expression.


Deleting Parts of an Expression

Use the following procedure to delete part of an expression and place it on the clipboard:

  1. Place the expression you want to delete between the editing lines.

  2. Choose Cut from the Edit menu. This leaves behind an empty placeholder.

If you do not want the expression on the clipboard, use the following procedure to delete part of an expression:

  1. Hold the mouse button down and drag the cursor across the expression you want to delete. It becomes highlighted in reverse video.

  2. Press the Delete key. This leaves behind an empty placeholder.

Note:

BkSp will generally delete whatever is to the left of the insertion line. When the expression to be deleted is something more complicated than a name or number however, pressing BkSp highlights it as shown. Pressing BkSp again will then delete it. This makes it harder to accidentally delete an expression.


Finding and Replacing Characters

To find a character(s):

  1. Choose Find from the Edit menu to bring up the Find dialog box.

  2. In the "Find what" text box, enter the character(s) to find.

  3. To find the character(s) in a text region, make sure "Find in Text Regions" is selected; to search through math regions, select "Find in Math Regions". You may search through both types of regions simultaneously.

  4. Click "Find Next."

To find and replace a character(s):

  1. Choose Replace from the Edit menu to bring up the Replace dialog box.

  2. In the "Find what" text box, enter the character(s) to find.

  3. In the "Replace with" text box, enter the character(s) with which to replace the located character(s).

  4. Click "Find Next."

  5. You then have three choices:

  • Click "Find Next" to find and select the next instance of the item you are searching for.

  • Click "Replace" to replace the currently selected instance of the item and find the next instance.

  • Click "Replace All" to replace all instances of the item you are searching for.


Formatting Results

The results of a worksheet calculation can be formatted. The way the numeric results are displayed is called the result format. You can control the result format for all the results in a worksheet or for a particular result.

To control the display of all results

To control the display of a particular result

The result format affects only the display of a result. The worksheet continues to carry out all calculations in full precision regardless of formatting options.


Math Styles

Each name or number in an equation is assigned a math style, and each tag is assigned a font, size and style. This lets you change the font characteristics of many names at once. Click on one of the following topics to use math font styles in a particular context:

Changing the font for all variables

Changing the font for all constants

Changing the font of a particular variable

Inserting Greek variables


Highlighting a Region

To render an equation, text region, graph, or any region more conspicuous by changing the background color underneath it:

  1. Click in the region.

  2. Choose Properties from the Format menu.

  3. Click on the Display tab.

  4. Click "Choose Color" to choose a highlight color other than the default.

  5. Click in the box next to "Highlight Region."

  6. Click "OK."

You'll see a box around the region filled with a color light enough so you can still see the equation itself. This has no effect on the equation other than highlighting it.

To restore the background to its original state:

  1. Click in the region.

  2. Choose Properties from the Format menu.

  3. Click on the Display tab.

  4. Click in the box next to "Highlight Region."


Viewing a Numerical Result in Full Precision

All arithmetic is carried out with full precision regardless of how the number appears in your worksheet. You can display a particular result in full precision either permanently, by changing its format, or temporarily as follows:

  1. Click in the number you want to view in full precision.

  2. Press Ctrl+Shift+N.

You'll see the number, in full precision, in the message line of the Status Bar at the bottom of your window.

Note:

You can view the full precision of a single value but not an array of values. To see the full precision of a resulting array, change its format settings. Increase the displayed precision in the Result Format dialog box to 15.


Overview of Text Features

Text regions function as commentary in a worksheet, explaining and annotating your work. You insert text regions anywhere in a worksheet and edit and format them as necessary.

Like other regions, text regions can be edited. You copy them, cut them, and delete them. You can also move a text region anywhere in your worksheet.

Text regions support many text formatting features of word processors. You can change the format of the characters in a text region and check the spelling of text. You can also format paragraphs within text regions by specifying the alignment and indentation or by applying bullets or numbers.

Text regions have certain properties which specify how they behave and look. For example, you can control the width of the text region. You can also specify whether it moves other regions out of the way as it grows.

  • Creating and editing text - inserting, cutting, copying, pasting text regions, etc.

  • Formatting text - Changing fonts, adding bullets, numbers, alignment, indentation

  • Controlling text region properties - controlling width, interaction with other regions


Creating a Text Region

To create a text region:

  1. Click wherever you want to place the region.

  2. Choose Text Region from the Insert menu. A text box appears.

  3. Begin typing. As you type, the text box grows to accommodate your text. The text box disappears when you click outside the text region. The text is formatted according to the “Normal” text style.

To stop entering text, click outside the text region. Do not press "Enter." Doing so will simply create a new line inside the text region.

Tip:

Another way to create a text region is to let your worksheet automatically create a text region. Simply click wherever you want text and start typing. Whatever you type is considered a math region, but as soon as you press the Spacebar, it automatically turns into a text region.


Importing Text

To paste text from another application into your worksheet:

  1. Copy the text from that application into the clipboard.

  2. Click in the worksheet and choose Paste from the Edit menu.


Selecting Text

To select a group of characters:

  1. Place the insertion point at one end of the selection.

  2. Drag the mouse to the other end of the your selection.

  3. Once there, let go of the mouse button. The selected area will be highlighted.

Other ways to select text:

  • To select one word of text, double-click on the word to highlight it.

  • To select a paragraph, triple-click on a word in the paragraph.

  • To select text character by character, word by word, or line by line use the arrow keys.

Note:

  • This feature is available only for text that you add, not for existing content.


Editing Text

To copy or cut text:

  1. Select the text

  2. Choose Copy or Cut from the Edit menu to place the text on the clipboard.

To paste text:

  1. Click in the text region into which you wish to paste text.

  2. Move the insertion point to wherever you want to insert the text.

  3. Click Paste from the Edit menu to paste the text.

To delete text from an existing text region, click in the region and:

  • Press Bksp to delete the character to the left of the insertion point.

  • Press Del to delete the character to the right of the insertion point.

To overtype text:

  1. Place the insertion point to the left of the first character you want to overtype.

  2. Press the Ins key and begin typing. The insertion point now has a break in the middle to indicate that you are in overtype mode. To return to the default insert mode, press Ins again.


Moving Text

To drag a text region:

  1. Select the text region.

  2. Move the mouse pointer to one of the borders of the selection rectangle. The pointer turns from an arrow into a small hand.

  3. Drag the mouse. The selected text will move with it.

To cut and paste a text region:

  1. Select the text region.

  2. Choose Cut from the Edit menu to cut it to the clipboard.

  3. Click the mouse where you want to put the text and choose Paste from the Edit menu.


Inserting Math in Text

You can insert a math region into a text region. The math region will continue to be live, just as if it were outside text. To insert a math region into a text region:

  1. Click in the text region into which you want to place the math region.

  2. Choose Math Region from the Insert menu or press Ctrl Shift A to create an empty placeholder.

  3. Type the equation into this placeholder just as you would enter it anywhere else in your worksheet.

When you're done entering the equation, click elsewhere in the text region to go back to text mode.

Note that when you insert a math definition into text, it affects calculations throughout the worksheet. If you want the definition to be purely cosmetic, you can turn it off.


Checking the Spelling of Text

To check the spelling of text in your worksheet:

  1. Select the text you want to spellcheck. If you do not select text, the spell-checker will check all the text in the worksheet, from the cursor to the end of the worksheet.

  2. Choose Check Spelling from the Tools menu.

  3. When the spell-checker finds a misspelled word, it brings up the Check Spelling dialog box showing the misspelled word along with any suggested replacements. The spell-checker considers a word misspelled when it is not found in its dictionary. You can add words to the dictionary, if necessary, using the Check Spelling dialog box.

Note:

To change the spell check dialect used, choose Preferences from the Tools menu and set the "Spell Check Dialect" in the Preferences dialog box.


Changing Text Font Properties

When you first enter text, its properties are determined by the worksheet defaults for the style called “Normal.” To change the font, style, size, color, or position of a particular section of text:

  1. Select the text.

  2. Choose Text from the Format menu.

  3. Choose from among the various font properties available in the dialog box and click "OK."

Note that in order to change all the text based on a particular text style, you need to modify the style properties or you can apply a different style.


Changing Text Paragraph Properties

Properties that apply to paragraphs within a text region are:

  • Indentation

  • Alignment

  • Numbers

  • Bullets

  • Tab stops

To change these properties for one or more paragraphs in a text region:

  1. Select text within the paragraph(s).

  2. Choose Paragraph from the Format menu.

  3. Make the appropriate changes in the Paragraph Format dialog box and click “OK.”

Or to quickly change alignment, bullets, or numbers:

  1. Select text within the paragraph(s).

  2. Click one of the alignment buttons [image], the bullets button [image], or the numbering button [image] on the Formatting toolbar.

To quickly set tab stops and indents:

  1. Select text within the paragraph.

  2. Choose Ruler from the View menu.

  3. Click in the ruler to set tab stops. Move the arrows on the ruler to set alignment.

Notes:

  • A paragraph begins at the start of a text region or after the Enter key is pressed. A paragraph contains all the characters up to where the Enter key is pressed.

  • To insert a new line within a paragraph, press Shift+Enter.


Text Styles

You can use text styles to assign default properties to the paragraphs within text regions. Every worksheet has a default, “normal” text style but other styles are available. You can apply a style to one or more paragraphs, modify an existing style, create a new style, or delete a style.

Applying a text style

Modifying a text style

Creating a text style

Deleting a text style


Applying a Text Style

When you create a text region, the “Normal” text style is applied to all the paragraphs in the text region. However, the worksheet may contain other text styles, which you can apply to any paragraph of text you have created.

To apply a different text style to one or more paragraph:

  1. Click in a paragraph so that the insertion point appears or select text lying in the paragraph(s).

  2. Choose Style from the Format menu to see the Text Styles dialog box.

  3. Select one of the available text styles and click “Apply.” The default text in your region acquires the text and paragraph properties associated with that style.

Notes:

  • As an alternative to choosing Style from the Format menu, you can choose a style from the left-most drop-down list in the Formatting toolbar.

  • When you apply a text style to a text region, the region’s paragraph properties change to those of the applied text style.

  • Text you have previously selected and formatted by changing the font properties will retain its previous appearance. If you previously only modified text properties other than the font in the selected text, the selected text acquires the text properties of the style with the addition of the particular style, size, and effects chosen.


Modifying an Existing Text Style

To change all the text based on a particular text style, such as the default text style “normal,” modify the text style:

  1. Choose Style from the Format menu to bring up the available styles.

  2. Select the name of the text style you want to modify and click “Modify.” You see a dialog box displaying the definitions of that text style.

  3. Click on the “Font” button to modify the text formats such as the numbers for that text style.

  4. Click “OK” to save your changes.

Any new text regions to which you apply the modified text style reflect the new definition for that text style. In addition, any text regions previously created with the text style redisplay according to the definitions of the new text style.


Creating a New Text Style

To create a new text style:

  1. Choose Style from the Format menu to see the Text Styles dialog box showing the currently available text styles.

  2. Click “New.”

  3. In the Define Styles dialog box, enter a name for the new style in the “Name” text box.

  4. If you want to base the new style on one of the existing styles in the current worksheet or template, select a style from the “Based on” drop-down list.

  5. Click on the “Font” button to make your choices for text formats for the new style. Click on the “Paragraph” button to choose paragraph formatting options for the new style.

  6. Click “OK” when you have finished defining the new style.

Your new style now appears in the Text Styles dialog box and can be applied to any text paragraph. When you save the worksheet, the new text style is saved with it. If you want to use the new text style in your future worksheets, save your worksheet as a template.


Deleting a Text Style

You may choose to delete a text style at any time. To do so:

  1. Choose Style from the Format menu to display the available text styles.

  2. Select one of the available text styles from the list.

  3. Click “Delete.”

The text style is removed from the list of available text styles, but any text in your worksheet whose properties were defined in terms of that text style will continue to display the properties of that style.


Controlling the Width of a Text Region

As you type into a text region, the region will continue to grow until it encounters the right margin. Then a second line forms. To change the width of a text region, resize it manually or make it automatically occupy the full width of the page.

Resizing a text region manually

There are two ways to resize a text region manually:

  • Using the mouse, and

  • Using the keyboard.

Enlarging to the full width of the page

To force a text region to automatically occupy the full width of a page:

  1. Click in the text region.

  2. Choose Properties from the Format menu.

  3. Click on the Text tab.

  4. Click "Occupy Full Width."

  5. Click "OK."

The text region expands to fit the width of the page. Also, for convenience, the text region moves other regions out of the way as it gets bigger.

Note:

  • Once a text region has been created, changing the right margin has no effect on its width.


Behavior of a Growing Text Region

You can specify whether a text region overlaps other regions or pushes other regions out of the way as it gets bigger.

By default, a growing text region overlaps other regions that it runs into. As you type text, the text region grows until it hits the right margin. Then a new line forms below. If any other regions are below or to the right of the growing text region, the text simply overlaps them.

If, instead, you want the other regions to move rather than allow the text to overlap them, you can change the properties for the text region. To do so:

  1. Click in the text region.

  2. Choose Properties from the Format menu.

  3. Click on the Text tab.

  4. Click on "Push Regions Down As You Type."

  5. Click "OK."


Controlling Calculation (generally)

Controlling Calculation

Your calculation mode controls how often the results on your screen are updated. Your worksheet will always be in one of two calculation modes:

  • Automatic mode in which results are updated continuously, and...

  • Manual mode in which you control when results are updated.

While in either mode, you can turn specific equations on or off or interrupt a calculation in progress.


Iteration and Looping

Range variables

How to define variables whose value iterates through a range.

Repeatedly evaluating an expression

How to use range variables to evaluate expressions at several values.

Iteration over a range of values

How to use range variables with arrays and functions to perform simple iteration.

Difference equations

Evaluate the solution of a difference equation recursively by using range variables.

Iterated calculations

Evaluate the solution of a system of coupled difference equations recursively by using range variables.


Doing Calculations in Parallel

Any calculation performed with single values, can also be performed with arrays of values. There are two ways of doing this:

  • By iteration over each element using range variables as subscripts.

  • By using the vectorize operator which performs the same operation efficiently on each element of a vector or matrix.


Error Messages in Numerical Calculations

Any errors in a worksheet are marked with an error message and the offending name or operator is highlighted in a different color (usually red).

The worksheet cannot process an expression containing an error. In order for an expression to process, you must fix the error.

For information on a particular error message, click on it in the list below:

A “Find” or “Minerr” must be preceded by a matching “Given”.

All evaluations resulted in either an error or a complex result.

All the elements in the vector cannot be the same.

Arguments in function definitions must be names.

At least one limit must be infinity.

Can only evaluate an nth order derivative when n=0,1..5.

Can only plot positive values when log axes are used.

Can't converge to a solution. Encountered too many integrator steps.

Can’t converge to a solution. The integrand may have a singularity or the integral may not be finite.

Can’t define the same variable more than once in the same expression.

Can’t determine what units the result of this operation should have.

Can't evaluate this expression. It may have resulted in an overflow or an infinite loop.

Can't evaluate this expression because it's either too complicated or it's defined in terms of itself.

Can’t evaluate this function when its argument is zero.

Can't find a solution. Encountered too many iterations.

Can’t find a solution to this system of equations. Try a different guess value or check that a solution really exists.

Can’t find the data file you’re trying to use.

Can’t have anything with units or dimensions here.

Can't have more than one array in a contour plot.

Can’t perform this operation on the entire array at once. Try using “vectorize” to perform it element by element.

Can’t plot this many points.

Can’t raise an expression having units to a complex power.

Can’t solve a system with this many equations.

Can’t understand something in this data file. If this file came from a spreadsheet, make sure you saved it as ASCII text only.

Can’t understand the name of this function. If you’re trying to multiply, use ”*”.

Can’t understand the way this range variable is defined.

Can’t understand this number.

Can’t use a range variable in a solve block.

Cannot evaluate this accurately at one or more of the values you specified.

Cannot perform this operation on a string.

Could not find a solution.

Could not find a solution because the root finder failed.

Cross product is defined only for vectors having exactly three elements.

Degree of the polynomial must be between 1 and 99.

Encountered a file i/o error.

Encountered a floating point error.

End of file

End points cannot be the same.

Error in ODE Block

Found a number with a magnitude greater than 10^307 while trying to evaluate this expression.

Found a singularity while evaluating this expression. You may be dividing by zero.

Illegal context. Press F1 for Help.

Illegal dimensions

Invalid expansion point

Invalid matrix dimension.

Live symbolics not available

Loess cannot extrapolate.

Matrix is singular. Cannot compute its inverse.

Matrix must be positive definite.

Must be >= 10^-16

Must be 1 complex matrix or 2 real matrices.

Must be a vector of real elements.

Must be between two locked regions.

Must be less than the number of data points.

Must be real scalar

Must have more than four rows.

Must have one or two columns.

Must have 3 vectors or one matrix.

No bitmaps were found in the worksheet.

Not enough memory for this operation.

Nothing to unlock.

Only positive values are allowed here.

ORIGIN should be an integer whose magnitude is less than 16 million.

(Rows - 1) must be power of 2.

Something is wrong with the solve block used to define the function. It may need a guess value.

String contains the wrong number of characters or the wrong kind of characters.

The elements in this vector must be in increasing order.

The expression to the left of the equal sign cannot be defined.

The format of this vector is invalid. Press F1 for help.

The function values on the two bracket end points must be of opposite signs.

The number of bits per pixel must be 8 or 16.

The number of rows must be a power of 2.

The number of rows or columns do not match.

The number of rows and/or columns in these arrays do not match.

The unit placeholder can only have real, non-zero scalars put into it.

The units in this expression do not match.

There is an extra comma in this expression.

There must be more data points than parameters.

There must be more than three data points.

This array must have more than one row or column.

This expression has a “(“ without a matching “)”.

This expression is incomplete. You must fill in the placeholders.

This expression is incomplete. You must provide an operator.

This expression is too complicated. Try defining it in smaller pieces.

This file could not be opened. Make sure it exists.

This function has too many arguments.

This function is undefined at one or more of the points you specified.

This function needs more arguments.

This image format is not supported.

This integer is too large.

This integer is too small.

This is invalid. If you are using conditional statements in a Mathcad program, make sure all cases are accounted for.

This is not a valid interval.

This is not allowed inside a solve block. For example, definitions are not allowed in a solve block.

This list contains too many items.

This matrix must be square. It should have the same number of rows as columns.

This must be an integer. The expression you used appears to have a fractional part.

This must be the name of a function or variable.

This must be the name of a mapping function.

This operation can only be performed on a function.

This operation can only be performed on an array. It can’t be performed on a number.

This operation can only be performed on a number or an array.

This operation can only be performed on a string.

This subscript is too large.

This system of equations has more unknowns than there are equations.

This value must be a matrix.

This value must be a vector. It can be neither a matrix nor a scalar.

This value must be an integer greater than 1.

This value must be an odd integer.

This value must be greater than or equal to 10.0^-16.

This value must be less than or equal to 10000.

This value must be real. Its imaginary part must be zero.

This variable must be a range variable.

This variable or function is not defined above.

This vector has the wrong number of elements.

This vector must have fewer than five columns.

This vector should have more elements.

Type “TOL=” to see what the tolerance is set to; it should be greater than 0 and less than or equal to 1. Redefine it if necessary.

Underflow

Value of subscript or superscript is too big (or too small) for this array.

You are trying to use an array or range as a scalar. Press F1 for help.

You must evaluate this operator symbolically. Press [Ctrl] [Period].

You interrupted calculation. To resume, click here and press "F9".


Symbolic Optimization

Ordinarily, Mathcad evaluates an expression exactly as you type it in. It does so even if a little bit of simplification would have made the expression much easier to evaluate.

You can use Symbolic Optimization, however, to force the numerical processor to make simplifications before it tries to evaluate. Look at the example below to see an example of the difference Symbolic Optimization can make for a calculation:

To optimize all the expressions in a worksheet when possible:

  1. Choose Optimize from the Tools menu.

Once you do this, Mathcad submits all expressions to the symbolic processor before trying to evaluate them. If the symbolic processor finds a simpler form, it marks the expression with a red asterisk. To see the simplified form of the expression, double-click on the asterisk or click with the right mouse button on the expression and choose Show Popup. Mathcad uses this simpler form in all subsequent calculations.

To optimize an individual expression rather than all expressions in the worksheet:

  1. Click on the equation and choose Properties from the Format menu.

  2. Click on the Calculation tab and click in the box next to “Enable Optimization” to place a check in the box.

If Mathcad optimizes the expression, it places a red asterisk next to it. If Mathcad cannot optimize the expression, it marks the expression with a blue asterisk.


Selecting Regions

To select one region:

Click on the region. This encloses it in a selection rectangle. You will see three handles.

To select more than one region:

  1. Click the mouse just outside a corner of the area enclosing the region(s) you want to select:

  2. Press and hold down the mouse button. With the button still held, drag the mouse. Dashed lines will indicate the extent of the selection rectangle.

  3. When the selection rectangle touches all the regions you want to select, let go of the mouse button. All selected regions are enclosed by dashed selection rectangles.

Other ways to select regions:

  • Hold down the Ctrl key and click on each region you want to select.

  • Use the Shift key to select several regions at a time.

  • To select a math region, click in the region, hold the mouse down, and drag the cursor so that the region is highlighted in reverse video. You can then cut, copy, or delete the region.

After you’ve selected one or more regions, you can move or delete them. You can also change what you’ve selected if necessary.


Moving a Region

You can move a region by cutting and pasting it to a new spot, by dragging it, or by nudging using arrow keys:

Cutting and pasting

  1. Select the region(s) you want to move.

  2. Choose Cut from the Edit menu.

  3. Click where you want to move the region(s).

  4. Choose Paste from the Edit menu.

Dragging one region

  1. Select the region by clicking on it.

  2. Move the mouse pointer to one of the borders of the selection rectangle. The pointer turns from an arrow into a small hand.

  3. Press and hold down the mouse button while dragging the mouse. An outline of the region moves with the mouse.

  4. When the outline of the region is where you want it, release the mouse button.

Dragging several regions

  1. Select the regions with the dashed rectangle by dragging over them..

  2. Move the mouse pointer onto the middle of one of the regions. The pointer turns from an arrow into a small hand.

  3. Press and hold down the mouse button while dragging the mouse. An outline of the region moves with the mouse.

  4. When the outline of the region is where you want it, release the mouse button.

Selecting separated regions or single regions

Note: You can select one or more individual regions by pressing [Shift] and clicking on them. Doing so again, unselects a region.

Nudging regions with arrow keys

Once a group of regions or a region has been selected, you can use the arrow keys on your keyboard to nudge them up, down, left, or right. Holding down the arrow key moves them more quickly.


Inserting and Deleting Blank Lines

To insert one or more blank lines...

To delete one or more blank lines...


Manipulating Overlapping Regions

Your worksheet allows different regions to overlap. To make two regions overlap, simply drag one region over the other. You can do the following with overlapping regions:

  • To move a region in front of another region overlapping it, right-click on the region and select Bring to Front from the pop-up menu.

  • To move a region behind another region overlapping it, right-click on the region and select Send to Back from the pop-up menu.

If you don't want regions to overlap at all choose Separate Regions from the Format menu to separate the regions.


Aligning Regions

You can align regions using Alignment buttons, menu commands, the Worksheet Ruler guidelines, or by Nudging with arrow keys.

Aligning Regions Vertically

To align two or more selected regions along a vertical line midway between the leftmost and rightmost region:

  1. Select the regions you want to align.

  2. Choose Align Regions Þ Down from the Format menu.

Note that this action makes it possible to inadvertently cause regions to overlap. If this happens, choose Separate Regions from the Format menu to separate them.

Setting Vertical Alignment Guides

You can also align regions by setting alignment guidelines using the worksheet Ruler under the View menu. Using these guidelines allows you to more easily align regions down multiple pages, and you can set as many alignment guides as you need.

Aligning Regions Horizontally

To align two or more selected regions along a horizontal line midway between the highest and lowest region:

  1. Select the regions you want to align.

  2. Choose Align Regions Þ Across from the Format menu.

Note that this action makes it possible to inadvertently cause regions to overlap. If this happens, choose Separate Regions from the Format menu to separate them.

Nudging Regions

  1. Select the regions you want to align by clicking and dragging over them to get a dotted line selection box.

  2. To select a single region or separated regions, hold down the [Shift] key while clicking on each one.

  3. Then use the Arrow keys to nudge the regions in any direction you want to align or move them.


Separating Overlapping Regions

The regions containing equations and text in your worksheet are bigger than they look. To see how big a region really is:

  • Choose Regions from the View menu.

If the regions overlap, you can either:

  • Select them and drag them out of the way, or

  • Choose Separate Regions from the Format menu.


Collapsing an Area in Your Worksheet

You can collapse a portion of your worksheet to hide from view. This may help you in creating more presentable worksheets, and you can lock a collapsed area to prevent anyone from making changes to regions inside the area.

To designate what area to collapse...

To collapse the area...

To expand a collapsed area...

To lock a collapsed area...

To delete a collapsed area...


Creating a New Worksheet

To create a new worksheet:

  1. Choose New from the File menu to bring up the New dialog.

  2. Choose a template on which to base your worksheet.

  3. A new, untitled window will open. Depending on the template you chose, you may see equations, text, or other regions which you can edit.

  4. Choose Save from the File menu and enter a name for the worksheet. The extension for the worksheet will be “.mcd”.


Opening an Existing Worksheet

To open a worksheet:

  1. Choose Open from the File menu to display a list of worksheets in the current directory. To see a list of worksheets other than the default type and file extension, change Files of type as necessary.

  2. Double-click on the name of the worksheet you want to open. If you need to change the current directory, click in the scrolling list of the Open dialog box. If you want to open a worksheet located on a remote web server, enter the worksheet's URL in the File Name field.

  3. Press Enter.

You can also open a worksheet that has been saved in HTML.


Closing a Worksheet

To close the active worksheet:

  1. Choose Close from the File menu.

  2. If any changes have been made to this worksheet since it was last saved, you'll be prompted to save the worksheet before closing.

If you want to exit the application completely, choose Exit from the File menu.


Renaming a Worksheet

To rename a worksheet:

  1. Choose Save As from the File menu to display a dialog box.

  2. Enter the new name of the worksheet in the text box.


Managing Worksheet Windows

Although you can open several worksheets at once, only one worksheet will be the active worksheet. Here are some things you may want to do to your active worksheet:

Move it...

Resize it...

Maximize its size...

Iconify it...

Close it...

Replace it with another...

Stack it neatly on top of the other worksheets...

Tile it together with the other worksheets...


Creating a New Template

There are a variety of built-in templates provided. You can extend the collection of templates by creating your own. For example, you may want to create a template for a project that contains specific information in the worksheet header and footer, graphs and text in certain places, or you may want to customize other settings.

Note that Mathcad templates, with an .mct extension, are different from HTML templates, with an .mlt extension. HTML templates set the look of a document in a Web browser, and Mathcad templates set the styles inside Mathcad.

To create a new template:

  1. Create a new worksheet having the settings you want. The worksheet should also contain any equations, text, and graphics that you want in the template.

  2. Choose Save As from the File menu to display a dialog box.

  3. Double-click on the Template folder in the Save As dialog.

  4. In the “Files of type” drop-down list, select “Mathcad Template.”

  5. Type a name for the template in the “File name” box.

  6. Click “Save.” The file is saved as a template file (with the extension .mct) in the template subdirectory by default, but you may save it in another location if you wish.

Your template will be added to the list of templates available in the dialog box when you choose New from the File menu to create a new worksheet.


Modifying a Template

To modify an existing worksheet template,

  1. Choose Open from the File menu.

  2. In the “Files of type” drop-down list, select “Mathcad Template.”

  3. Type the name of the template in the “File name” box, or browse to the Template directory or elsewhere to locate it.

  4. Click “Open.” The template opens.

  5. Edit the template as you would modify any other worksheet.

  6. Choose Save from the File menu. If you want to give a new name to the modified template, choose Save As from the File menu instead and enter a new name for the template in the dialog box.

Note that when you modify a template, your changes affect only new files created from the modified template. The changes will not affect any worksheets created with the template before the template was modified.


Creating a New HTML Template

A sample HTML template is provided in the templates directory. HTML templates are used when you save a document as HTML. You can extend the collection of templates by creating your own. For example, you may want to create a template for a Web site that contains navigation buttons in the header and footer, images or dates in certain places, or you may want to apply an external CSS style sheet in the head of every Web file.

To create a new template:

  1. Open a new file or the existing sample template file in any text or HTML editor.

  2. Make sure the following comment regions are in your file:

    In the document <HEAD> tags:

    <!-- #BeginEditable "MathMLheaders" -->
    META tag information written here
    <!-- #EndEditable -->

    <!-- #BeginEditable "MathMLstyles" -->
    Cascading styles written here
    <!-- #EndEditable -->

    In the document <BODY> tags:

    <!-- #BeginEditable "MathMLcontent" -->
    MathML Content from Mathcad worksheet written
    <!-- #EndEditable -->

  3. Add any additional HTML markup you want to appear on every page you export to MathML.

  4. Save the file with your chosen template name and an .mlt extension.

Your template is browsable from the HTML Options tab in the Preferences dialog box.


Headers and Footers

Defining Headers and Footers

To add headers and footers to your printout:

  1. Choose Headers and Footers from the View menu to open the Header and Footer dialog box.

  2. Click on either the "Header" or the "Footer" tab.

  3. Click in the text box corresponding to where you want to put the header or footer.

  4. Type the appropriate text. Use the buttons in the Tools section of the dialog box to insert information such as page numbers, the date, or the time. Use the other options in the dialog box to:

  • Start the page numbering at a number other than 1.

  • Define a special header or footer for the first page of the worksheet.

  • Put frames around the header, footer, or entire page.

  • Insert a bitmap.

  • Format the font.

  5. When you are done, click "OK."


Margins

Setting Page Margins

To set margins:

  1. Choose Page Setup from the File menu.

  2. Click in the text box corresponding to the margin you want to move.

  3. Enter the number of inches from the margin to the edge of the sheet of paper you'll be printing on.

  4. To apply these margin settings to the current worksheet, click "OK."


Mailing a Worksheet

Before you can use this feature, you must be connected to a compatible mail system.

To mail your worksheet:

  • Choose Send from the File menu.

The worksheet is attached to the message you are prompted to create.


Exporting to Microsoft Word

To export a worksheet to Microsoft Word, you can save the worksheet as an RTF file, or you can copy and paste the worksheet regions.

Exporting as RTF

You can turn an entire worksheet, complete with equations and plots, into an RTF file readable by Microsoft Word. The layout will match the original worksheet and the text can be further edited in Word. All math regions and graphs will turn into images in the Word document.

Since the default margins in Word are different than those in Mathcad, we recommend using the Microsoft Word template under New in the File menu. Or you can set your margins in the Mathcad worksheet to match the margins in Word, using Page Setup under the File menu in both programs.

Note that anything beyond the right margin in a Mathcad worksheet will not show up in the Microsoft Word document.

To save a Mathcad worksheet as RTF for Microsoft Word:

  1. Use the Microsoft Word template in Mathcad or set your margins to match those in the Word document.

  2. Make sure the material you want to export is within the right margins.

  3. Choose Save As from the File menu.

  4. Choose Rich Text Format (*.rtf) from the "Save as Type" drop-down list in the Save As dialog box.

  5. In the File Name box, type the name of the RTF file you want to create.

When you open this RTF file with Microsoft Word, you may find all the regions lined up one above the other at the left edge of the documents. If so, switch to Word's Print Layout), which will more accurately display your worksheet's appearance.

Copying and pasting

Another way to export a worksheet is to copy one or multiple regions in the worksheet and paste them into another application. To do so:

  1. Choose Select All from the Edit menu to copy all regions or select individual regions by dragging over them, or [Shift]click on each one.

  2. Choose Copy from the Edit menu.

  3. Open Microsoft Word and paste.

Under Paste Special, you have several options. If you choose Mathcad Document Object, then when you edit a math region, it will open up Mathcad's toolbars and menus. You can also choose to import the Mathcad regions as pictures, unformatted text, or RTF (formatted text).


Printing Selected Pages

To print selected pages:

  1. Get the page numbers by looking at the indicator on the lower left of the window.

  2. Choose Print from the File menu to bring up the Print dialog box.

  3. Click the button beside "Selected pages."

  4. Type the page range you want to print in the text boxes beside "From" and "To." To print only one page, type the same page number in box boxes.

  5. Click "OK."


Printing Selected Regions

Printing Parts of a Page

To print selected regions:

  1. Ctrl+Click on the regions you want to print. This puts a dashed rectangle around each region indicating that they are selected.

  2. If you change your mind about a selected region, Ctrl+Click on it again. This removes the dashed rectangle from around that region.

  3. Choose Print from the File menu to bring up the Print dialog box.

  4. Click the button beside "Selection."

  5. Click "OK."


Print Preview

Previewing Your Output

To see how your worksheet will look on the page before printing:

  1. Choose Print Preview from the File menu. The Print Preview screen shows the current page of your worksheet as it will appear when printed.

  2. Page through your worksheet using the “Next Page” and “Prev Page” buttons at the top of screen.

  3. Click “Close” to go back to the main Worksheet Window.

Once you see how your worksheet will look, you may want to make changes. Choose Page Setup from the File menu to change margins or add headers and footers.


Including One Worksheet Inside Another

There may be times when you want to use formulas and calculations from one worksheet in another. One way is to use Copy and Paste from the Edit menu to move whatever you need to move.

Another method is to insert a reference to a worksheet. This procedure makes the current worksheet behave as if you had inserted into it the actual regions from the referenced worksheet. You don't see the regions themselves, however. Instead, you see an icon showing where the referenced worksheet regions take effect.

To insert a reference to a worksheet:

  1. Choose Reference from the Insert menu to display the Insert Reference dialog box.

  2. In the dialog box, click the “Browse” button to locate and select a worksheet whose regions you want to refer to in the active worksheet. Alternatively, you may type the complete path or Internet address (URL) to a worksheet in the empty text box.

  3. Click the box next to “Use relative path for reference” if you want a relative path.

  4. Click “OK.”

Upon completing these steps, you'll see an icon:

and the name of the referenced worksheet showing where the referenced worksheet takes effect. If you double-click on the icon, you'll see the referenced worksheet. However, once you’ve inserted a reference to a worksheet, there is no need to have the referenced worksheet open.

To update a worksheet containing a reference, make the change on the referenced worksheet, save the sheet, return to the referencing worksheet, click on the reference and press the F9 key (“Calculate”). The calculation will then incorporate the change.


Creating a Hyperlink to a Worksheet

To insert a hyperlink to another worksheet or to any file:

  1. Select the region you want to turn into a link. It is recommended that you select text but you can select any region.

  2. Choose Hyperlink from the Insert menu to display the Insert Hyperlink dialog box.

  3. In the dialog box, click the “Browse” button to locate and select a worksheet or path or Internet address (URL) to a worksheet in the empty text box.

  4. Click the box next to “Use relative path for hyperlink” if you want a relative path. Click in the box next to “Display as pop-up” if you want the target worksheet to open in a small pop-up window when you double-click on the region containing the link.

  5. If you want a message to appear on the status line at the bottom of the window when the mouse hovers over the region containing the hyperlink, type a message in the text box at the bottom of the Insert Hyperlink dialog box.

  6. Click “OK.”

Once you complete these steps, you'll see that if you selected text to create a link, it is now underlined and bold. This indicates that a link has been created. Any other regions holding a link won’t look any different. Double-clicking on the text or other region will open the linked worksheet.


Creating a Hyperlink to a Region

Before you can link to a specific region in a worksheet, you must mark it with a tag. A tag uniquely identifies a region in a worksheet, allowing you to jump directly to that region. A tag can be any collection of words, numbers, or spaces, but no symbols. A tag can not have a period in it, such as Sec1.1 but you can write Sec1,1 or Sec1-1.

To create a region tag:

  1. Right-click on any region in your worksheet for which you would like to create a region tag.

  2. Select Properties from the pop-up menu.

  3. In the Properties dialog box, under the Display tab, type a tag in the text box provided and click “OK.”

Now you can link to that region from within the worksheet or from any other worksheet.

To create a hyperlink to a region that has been tagged:

  1. Click a region in your worksheet, and choose Hyperlink from the Insert menu.

  2. Click “Browse” to locate and select the target worksheet, or type the complete path or Internet address (URL) to a worksheet. You must enter the name of the target worksheet even if you are creating a hyperlink to a region within the same worksheet.

  3. At the end of the worksheet path type “#” followed by the region tag. The complete path for your target region will look something like this: C:\filename#region tag

  4. Make further desired specifications in the Hyperlink dialog box and click “OK.”

Note:

When you link from region to region within or between worksheets, you cannot use the pop-up window option.


Deleting a Hyperlink

To delete an existing hyperlink:

  1. Click anywhere in the region containing the link.

  2. Choose Hyperlink from the Insert menu.

  3. Click "Remove Link" in the Insert Hyperlink dialog box.

If selected text contained the link, you'll see that the text you selected is no longer underlined and bold. This indicate that the link no longer exists.


Locking an Area in Your Worksheet

You can designate a portion of your worksheet to be "locked". This prevents anyone from making changes to any of the regions inside the locked area.

To designate what area to lock...

To lock the area...

To unlock the area...

To delete a lockable area...


Controlling the Appearance of Area Boundaries

You can change the appearance of the area boundaries and the collapsed area bar for an inserted area. To do so:

  1. Click on one of the boundaries or the collapsed bar with the right mouse button.

  2. Choose Properties from the popup menu.

  3. Click on the Area tab and use the dialog to specify:

  • a name (if any) for the area and whether the name displays on the screen.

  • whether a timestamp appears on the boundaries.

  • whether an icon appears on the boundaries.

  • whether the border appears on the boundaries.


Protecting Your Worksheet

Rather than locking an entire worksheet, you can use Worksheet Protection to safeguard most or all of your worksheet. Worksheet protection comes in three levels: file, content, and editing.

  • With file-level protection, the worksheet can only be saved as Mathcad 2001i or higher, as RTF, as a Mathcad template (MTC), or as HTML. Protected files saved as HTML can not be read back into Mathcad. No restrictions are placed on any regions.

  • With content-level protection, the worksheet can only be saved as Mathcad 2001i or higher, as RTF, as a Mathcad template (MTC), or as HTML that can not be read back into Mathcad. Existing regions are protected by default and cannot be changed. New regions can be created and protected regions can be copied.

  • With editing-level protection, the worksheet can only be saved as Mathcad 2001i or higher, as RTF, as a Mathcad template (MTC), or as HTML that can not be read back into Mathcad. Existing regions are protected by default and cannot be changed. Protected regions cannot be edited or copied. No new regions can be created in the worksheet.

To protect your worksheet, choose Protect Worksheet... from the Tools menu; to turn off Worksheet Protection, choose Unprotect Worksheet... from the Tools menu. To disable protection for a region, right-click on the region, choose Properties from the menu, and de-select "Protect region from editing" on the Protect tab before protecting the worksheet.

When enabled and set at the content or editing level, worksheet protection prohibits access to any region not explicitly left unprotected; by default, a region is flagged for protection.

Note:

Regions added while worksheet protection is enabled (content level only) cannot be flagged for protection until the worksheet is unprotected.


Working with Arrays

While ordinary variables hold a single value, arrays (the general term for matrices and vectors) hold many values. You can create vectors and matrices and use them in your calculations and variable definitions just as you would numbers. Many operators and functions can be used with arrays, but there are also special array operators and functions for array manipulation.

Creating vectors and matrices

Displaying vectors and matrices

Graphing a vector

Computing with arrays

Changing the size of an array

Extracting elements, rows and columns

Beginning arrays at an element other than zero

Limits on array sizes

Vector and matrix functions

Vector and matrix operators

Matrix manipulation

Nested arrays


Creating Vectors and Matrices

The easiest way to create an array is to create an array of empty placeholders and just fill them in.

To create an array:

  1. Choose Matrix from the Insert menu to bring up a dialog box.

  2. Specify the number of rows and columns in the dialog box.

  3. Click "CREATE" to create an array of empty placeholders.

  4. Click on each placeholder to select it, then enter a number, an expression, or a string. Alternatively. use Tab to move through the placeholders.

For arrays in which there exists a formula relating the value of an array element to its indices, it is easier to use range variables and subscripts. The example below illustrates the technique:

i := 0 ..9

j := 0 ..9

X[i,j := i^2+j/2

You can also create an array by:

  • Importing data from a data file

  • Defining individual elements


Computing with Arrays

You can define a variable as an array and use it in your calculations:

  1. Click in empty space in your worksheet and type the variable name.

  2. Choose Matrix from the Insert menu to bring up a dialog box.

  3. Specify the number of rows and columns in the dialog box.

  4. Click "CREATE" and fill in the placeholders.

You can now use the name v in place of the actual vector in any equation:

Arrays are useful for performing parallel calculations.


Displaying a Vector or Matrix

There are two ways of displaying a vector or matrix:

  • If an array has fewer than ten rows and columns, you'll see it displayed in matrix form.

  • If an array has more than nine rows or columns, you'll see a portion of it displayed as a scrolling output table.

To do change the display of array results to either an output table or a matrix:

  1. Choose Result from the Format menu to bring up the Result Format dialog box.

  2. Set "Matrix display style" to "Matrix" or "Table." Click "Set as default" if you want all the arrays in your worksheet to be affected.


Graphing a Vector

To graph the elements of an N-element vector:

  1. Define a range variable from 1 to N.

  2. Press @ or choose Graph / X-Y Plot from the Insert menu to create an xy plot.

  3. Place the subscripted vector on one axis and the range variable on the other.

Graphing one vector against another is useful for plotting data points. Enter the x-values in one vector and the y-values in another. Then:

  1. Press @ or choose Graph / X-Y Plot from the Insert menu to create an xy plot.

  2. Type the name of the vector of x-values on the horizontal axis.

  3. Type the name of the vector of y-values on the vertical axis.

Note:

You can create a polar plot of a vector using similar steps. Simply insert the polar plot operator by choosing Graph / Polar Plot from the Insert menu and fill in the bottom and left placeholders.


Creating a Nested Array

The elements of an array can themselves be arrays. You create a nested array in the same way you create any array. The only difference is that you cannot use the Matrix command from the Insert menu when the selected placeholder is already inside a matrix.

The simplest way to define an array element that is itself an array is the following:

  1. Assign the array to a variable name:

  2. Define the matrix element in terms of this variable name:

The 1,1 th element of M is now the vector v.

Launch QuickSheet Example


Changing the Size of an Array

To join arrays side by side:

Use the augment function to combine arrays having the same number of rows. For example:

To stack arrays one above the other:

Use the stack function to combine arrays having the same number of columns. For example:

To insert or delete rows and columns:

  • Inserting rows

  • Deleting rows

  • Inserting columns

  • Deleting columns


Vector and Matrix Functions

Joining arrays

augment(A,B,C,...)

stack(A,B,C,...)

Unjoining arrays

submatrix(M, ir, jr, ic, jc)

Creating arrays

matrix(m,n,f)

CreateMesh(F, s0, s1, t0, t1, sgrid, tgrid, fmap)

CreateSpace(F, t0, t1, tgrid, fmap)

Size of an array

cols(A)

rows(A)

length(v)

last(v)

identity(n)

Extrema of an array

max(A,B,C,...)

min(A,B,C,...)

Lookup functions

lookup(z, A, B)

hlookup(z, A, r)

vlookup(z, A, c)

match(z, A)

Special types of matrices

diag(v)

geninv(A)

rref(A)

Special characteristics of a matrix

tr(M)

rank(M)

norm1(M)

norm2(M)

norme(M)

normi(M)

cond1(M)

cond2(M)

conde(M)

condi(M)

Eigenvalues and eigenvectors

eigenvals(M)

eigenvecs(M)

eigenvec(M,z)

genvals(M,N)

genvecs(M,N)

Matrix decomposition

cholesky(M)

qr(A)

lu(M)

svd(A)

svds(A)


Vector and Matrix Operators

The following operators have special meanings for vectors and matrices. Many of these operators are available from the symbol toolbar, but all have corresponding keystrokes. Note that operators which expect vectors always expect column vectors rather than row vectors.

Operator: | Keystroke:
addition | +
cross product | Ctrl+8
determinant | |
division | /
inner (dot) product | *
inverse | ^-1
magnitude | |
multiplication | *
powers of matrix | ^
negation | -
subscript | [
subtraction | -
sum elements | Ctrl+4
superscript | Ctrl+6
transpose | Ctrl+1
vectorize | Ctrl+-

Launch QuickSheet Example


Extracting a Smaller Matrix from a Matrix

submatrix(A,ir,jr,ic,jc) Returns the matrix consisting of rows ir through jr and columns ic through jc of array A.

Arguments:

  • A is an array.

  • ir and jr are the upper and lower indices of the rows to be extracted.

  • ic and jc are the upper and lower indices of the columns to be extracted.

To extract a single column, use the superscript operator. To extract a single row, use the transpose operator and the superscript operator.

Launch QuickSheet Example


Extracting Elements, Rows, and Columns

To access a particular array element, use the subscript operator and type an equals sign. For example:

To access an entire column at once, use the superscript operator as shown below:

To access an entire row, use the transpose and superscript operator together as shown below:


Working with Strings

Although you will usually be defining variables and functions in terms of numbers and other variables or functions, you may wish to define them in terms of a string of characters. Using the double quotes key to type a string, you can define variables, functions, and arrays in terms of a string.

Most built-in functions and operators do not make sense when used with strings. There are, however, several string functions for combining strings, finding substrings, determining the length of a string, and converting strings to numbers and vectors and vice versa.

Defining a string variable

Defining a string function

Defining an array element as a string

Built-in string functions


Defining a String Variable

To define a variable as a string:

  1. Type the variable name:

  2. Type ":" to create a ":=" with a placeholder:

  3. Press the double quotes key (“). You will see an insertion line between double quotes:

  4. Type any combination of letters, numbers, or other characters. Press Enter when you are finished:

Note:

The position of the first character in a string is zero. For example, in the string "yes" the letter "y" is the 0th character.


Defining a String Function

To define a function involving a string:

1. Type the function name together with its argument list:

2. Type ":" to create a ":=" with a placeholder:

3. Press the double quotes key (“). You will see an insertion line between double quotes:

4. Type any combination of letters, numbers, or other characters. Press the right arrow key to move out of a string:


User-Defined Error Messages

Defining Error Messages Using a String

error(S) Returns S as an error message.

Argument:

S is a string.

Example:


Concatenating Strings

concat(S1, S2, S3, ...) Returns a string formed by attaching string S2 to the end of string S1, S3 to the end of S2, and so on.

Arguments:

S1, S2, S3, ... are strings.

Example:

Launch QuickSheet Example


Converting a Number to a String

num2str(x) Returns the number string equivalent of x.

Argument:

x is a constant or an expression that returns a constant.

This function is useful when it is easier to manipulate a number as a string rather than mathematically.

Example:

Launch QuickSheet Example


Converting a String to a Number

str2num(S) Returns a constant equal to the number in S.

Argument:

S is a number string or an expression that returns a number string.

This function is useful when you need to perform calculations on a string of numbers.

Example:

Launch QuickSheet Example


Converting a Vector to a String

vec2str(v) Returns a string formed by converting the ASCII codes in v.

Argument:

v is a vector containing integers between 0 and 255.

Example:

Launch QuickSheet Example


Converting a String to a Vector

str2vec(S) Returns a vector of ASCII codes formed by converting the characters in S.

Arguments:

S is a string.

Example:

Launch QuickSheet Example


Extracting a Substring

substr(S,m,n) Returns the substring of S consisting of the characters from position n and having m characters.

Arguments:

  • S is a string.

  • m is the position of the first character in the desired substring. m must be a nonnegative integer.

  • n is the maximum possible length of the substring. n must be a nonnegative integer.

Example:

Note:

The position of the first character in a string is zero. For example, in the string "yes" the letter "y" is the 0th character.

Launch QuickSheet Example


Finding the Length of a String

strlen(S) Returns the number of characters in S.

Argument:

S is a string or an expression that returns a string.

Example:

Launch QuickSheet Example


Locating a Substring

search(S,SubS,m) Returns the starting position of SubS in S, found by beginning the search at position m. Returns -1 if SubS is not found.

Arguments:

  • S is a string.

  • SubS is a substring of S.

  • m is a nonnegative integer representing the position in S at which the search begins.

Example:

Note:

The position of the first character in a string is zero. For example, in the string "yes" the letter "y" is the 0th character.

Launch QuickSheet Example


Built-in Math Functions

You can insert any built-in function in the categories listed below by choosing Function from the Insert menu to open the Insert Function dialog box. Alternatively, you may type the names of the built-in functions exactly as they are shown on the Help pages in which they are described.

Bessel

Complex

Conditional

Coordinate system

Curve-fitting

Data analysis

Differential Equation Solvers

Discontinuous functions

Discrete Transforms

Distribution functions

Equation solving

Error function and complementary error function

Exponential and logarithmic functions

Expression type

File access functions

Finance functions

Function optimization

Histogram

Hyperbolic

Interpolation

Image reading

Image writing

Inverse hyperbolic

Inverse trig

Lookup

Miscellaneous

Optimization

Population statistics

Prediction

Random number generation

Regression

Round-off and truncation

Smoothing

Solving

Sorting

Special functions

Statistics

Strings

Symbolic calculation

Trigonometric functions

Vector and matrix functions


Arithmetic Operators

You can type any operator using its keystroke. Most operators are also available on the Calculator toolbar.

Operator: | Keystroke:
addition with linebreak | Ctrl+Enter
addition | +
complex conjugate | "
division | /
in-line division | Ctrl+/
factorial | !
exponentiation | ^
magnitude | |
multiplication | *
negation | -
nth root | Ctrl+\
product | Ctrl+Shift+3
range product | #
range sum | $
square root | \
subtraction | -
summation | Ctrl+Shift+4


Calculus Operators

You can type any operator using its keystroke. Most operators are also available on the Calculus toolbar off the Standard toolbar.

Operator: | Keystroke:
derivative | ?
nth derivative | Ctrl+?
definite integral | &
indefinite integral | Ctrl+I
summation | Ctrl+Shift+4
summation with range variables | Ctrl+4
iterated product | Ctrl+Shift+3
iterated product with range variables | Ctrl+3
two-sided limit | Ctrl+L
left-hand limit | Ctrl+A
right-hand limit | Ctrl+B


Boolean Operators

Boolean operators are unlike other operators in that they only return a zero or a one. Despite this, they can be very useful.

Operator: | Keystroke:
greater than | >
less than | <
greater than or equal | Ctrl+0
less than or equal | Ctrl+9
equal | Ctrl+=
not equal to | Ctrl+3
And | Ctrl+Shift+7
Or | Ctrl+Shift+6
Exclusive or (Xor) | Ctrl+Shift+5
Not | Ctrl+Shift+1


User-defined Operators

You can think of operators and functions as really being the same. Both take “arguments” and return results. Mathcad therefore allows you to define your own operators, just as you can define your own functions. You can define operators which accept one “argument” or two arguments.

  • Defining a custom binary operator

  • Defining a custom unary operator

  • Using a custom binary operator

  • Using a custom unary operator


Solving and Optimizing Overview

You can numerically solve a variety of optimization problems using various built-in functions. You can solve one equation for an unknown value using the root function. You also solve a system of equations using the Find or Minerr function. Use Find when you want to find an exact solution and Minerr when a close solution is sufficient.

The Minimize and Maximize functions solve optimization problems in which you are finding values that minimize or maximize a function. These problems include linear programming.

  • Solving one equation in one unknown

  • Solving a system of equations

  • Approximate solution to a system of equations

  • Optimizing a nonlinear function

  • Optimizing a linear function

  • What's behind the solving and optimizing functions?

  • Solving equations symbolically


Solving One Equation in One Unknown

Any such equation can be written as:

f(x) = g(x)

which can be simplified to:

f(x) - g(x) = 0

The solution is given by the root function:

root(f(x) - g(x),x)

or

root(f(x) - g(x),x,a,b)

Example 1:

Consider the equation:

cos(x) = x + .2

To solve this, you could write:

x := 1<--- Guess value

root(cos(x) - x - .2, x) = .616

Example 2:

In the Example 1, the guess value tells the root function where to begin looking for a root. In this example, the 3rd and 4th arguments specify an area in which to find a root.

Consider the equation:

sin(x) = .2

To solve this, you could write:

root(sin(x) - .2, x, 2, 4) = 2.94

Launch QuickSheet Example


Solving Linear Systems

lsolve(M,v) Returns the vector solving the linear system of equations Mx = v.

Arguments:

  • M is a square, non-singular matrix.

  • v is a vector having the same number of rows as M.

Launch QuickSheet Example


Solving a System of Nonlinear Equations

The example below illustrates how to solve two nonlinear equations in two unknowns using the find function.

Launch QuickSheet Example


Approximate Solutions to a System of Nonlinear Equations

The example below shows how to find the values that come closest to solving a system of equations using the minerr function.

Launch QuickSheet Example


Finding Roots

root(f(var1, var2, ...),var1, [a, b]) Returns the value of var1 lying between a and b at which the function f is equal to zero.

polyroots(v) Returns a vector containing all the roots of the polynomial whose coefficients are in v.

Arguments:

  • f is a scalar-valued function of any number of variables.

  • var1 is a scalar variable found in f. var1 in the second argument is the variable with respect to which the root is found.

  • a and b are optional. If included, they must be real numbers and a < b.

  • v is a vector containing coefficients of a polynomial in which the first element is the constant term.

Notes:

  • If you do not include the arguments a and b, the root function requires a guess value to start the root finding process. For functions with many roots, the root returned depends on the guess value. If the guess value is very close to a minimum or maximum of f, the root function may fail to converge, or converge to a root far away from the guess value.

  • The bracketed form of the root function only returns an answer when f(a) and f(b) are of opposite signs.

  • You can choose between two algorithms for the polyroots function.

Launch QuickSheet Example For the root function.

Launch QuickSheet Example For the polyroots function.


Using the Maximize and Minimize Functions

The example below shows nonlinear optimization using the M aximize function:

The example below shows nonlinear optimization using the Minim ize function:


Solving an Equation Symbolically

To solve an equation symbolically:

  1. Enter the left side of the equation.

  2. Press [Ctrl]= to make the equal sign (to find the root of an expression, do not type an equal sign and proceed to step 4).

  3. In the remaining placeholder, enter the right side of the equation.

  4. Select the variable you want to solve for.

  5. Choose Variable / Solve from the Symbolics menu.

The variable will be solved for and the result pasted into your worksheet.

If the equation has more than one solution, you'll see a vector having as many elements as there are solutions. If your equation includes numbers with decimal points, you'll see a decimal answer. Otherwise, you'll see an exact solution (if one is available).

To solve an inequality, follow the above procedure except type >, <, [Ctrl]( for £, or [Ctrl]) for ³ in place of the [Ctrl]=.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "solve" keyword and live symbolic evaluation instead.

Launch QuickSheet Example


Solving Differential Equations

Single ordinary differential equations

Solving 2nd order ordinary differential equations that are linear in the highest derivative term using odesolve.

Single ordinary differential equations - Alternative method

Solving a single 2nd order ordinary differential equation that is not linear in the highest derivative term, using rkfixed.

Systems of differential equations

Using rkfixed to solve a system of n ordinary differential equations.

Differential equations with special properties

Using the Bulstoer function for smooth systems, the Stiffb, Stiffr and Radau functions for stiff systems, and Rkadapt for slowly varying systems.

When you want only the last point

Functions to use when you're only interested in the solution value at the last point on the integration interval.

Two point boundary value problems

Using bvalfit and sbval to convert a two-point boundary value problem to an initial value problem amenable to solution by rkfixed.

Partial differential equations

Using relax and multigrid to solve Poisson's equation in a square region.

Launch QuickSheet Example


Overview of Data Management

Mathcad provides components to exchange data between Mathcad and other applications. A component communicates with the mathematical equations in Mathcad, linking your Mathcad computations to the rest of your computing environment. This link allows data to flow dynamically between the Mathcad worksheet and a data source or application.

Some components are used to import data, some to export data, and application components, such as Excel, Axum, and MATLAB, allow you to communicate with other applications installed on your computer.

See Using Mathcad with Other Applications in the QuickSheets under the Help menu, for samples of different Mathcad components.

  • Introduction to components

  • Importing data

  • Exporting data

  • Exchanging data with other applications

  • Using MathConnex


Importing Data

You can bring data into a worksheet by importing it once from a file, reading it from a file, reading it from a database, or pasting it in from the clipboard. These methods all create arrays of your data. You can also type the data into an input table or an array.

Importing data from a data file

Reading data from a data file

Reading data from an ASCII data file using a function

Reading data from a binary data file

Reading data from a database

Reading data from a measurement device

Creating a table of numbers

Creating a matrix or vector

Pasting in data from the clipboard


Importing Data from a Data File

When you want to import data once from a data file into your worksheet, you can use a Data Table. To do so:

  1. Click in a blank spot of your worksheet and choose Data from the Insert menu.

  2. Choose Table from the resulting submenu. A table with numerical row and column labels will appear.

  3. In the placeholder to the left of the table, enter the name of the variable to which this data will be assigned.

  4. Right click on the Data Table so that you see a pop-up menu.

  5. Choose Import.

  6. The File Options dialog box appears. In the “Files of type” text box, choose the type of file you'd like to import. Use the dialog box to browse to the data file and click “Finish” or "Next" if you wish to choose a subset of rows and columns in your data set.

Data from the data file appear in your worksheet in the table, assigned to the variable name you provided. You can now manipulate this array like any other Mathcad matrix or vector.

Note:

Data may not be imported properly from a data file if the file uses more than one delimiter.


Reading Data from a Data File

When you want to read data from a data file into a worksheet, you can use a File Input or Data Table component. These components allows you to either establish a connection to a data file, or import data once, and assign the data to a worksheet variable.

To read data from a data file using the Data File Input component:

  1. Click in a blank spot of your worksheet.

  2. Choose Data from the Insert menu.

  3. Choose File Input from the list. This launches the first part of the File Input Setup Wizard.

  4. From the File Format drop-down list in this Wizard, choose the type of file you want to read.

  5. Type the path to the data file you want to read or use the “Browse” button to locate it.

  6. Press “Next,” and select the options for starting and ending rows and columns in your data.

  7. Press "Finish." You’ll see the File Input component icon and the path to the data file.

  8. In the placeholder that appears to the left, enter the name of the variable to which the data from the file will be assigned.

When you click outside the component, the data file is read in and the data is assigned to the variable you entered into the placeholder. You can now manipulate the variable however you’d like. Each time you calculate the worksheet, the data will be re-read from the file you specified.


Reading Data from a Data File (READPRN function)

Reading Data From a Data File

READPRN(“file”) Returns an array containing whatever is in file.

Arguments:

  • file is either a filename or the full pathname to a structured ASCII data file.

  • file is entered as a string.

Examples:

READPRN(“data.prn”) reads in the file data.prn located in the default directory.

READPRN(“c:\mydata\final\output.prn”) reads in the file output.prn located in c:\mydata\final.

Note:

Whenever you change the argument to this function, click on it and choose Calculate from the Tools menu to update it.


Reading Data from a Binary Data File (READBIN function)

Reading Data From a Binary Data File

READBIN(“file”, “type”, [[endian], [cols], [skip], maxrows]]) Returns an array containing the binary data in file.

Arguments:

  • file is either a filename or the full pathname to a binary data file, and must be entered as a string.

  • type specifies the data format used in the file, and must be entered as a string. READBIN supports the following data types:

    • byte - 8-bit unsigned integer.
    • double - 64-bit floating point number.
    • float - 32-bit floating point number.
    • int16 - signed 16-bit integer.
    • int32 - signed 32-bit integer.
    • uint16 - unsigned 16-bit integer.
    • uint32 - unsigned 32-bit integer.

  • endian indicates whether the data in the file is big-endian (high byte first) or little-endian (low byte-first). Big-endian is represented by a 1, while little-endian is represented by a 0. If no value is specified, endian is assumed to be 0.

  • cols is the number of columns per row in the input file, and must be a positive integer. If not specified, cols is assumed to be 1.

  • skip is the number of bytes at the beginning of the file to ignore before reading in data, and must be a non-negative integer. If not specified, skip is assumed to be 0.

  • maxrows is the maximum number of rows of data to be read from the datafile, and must be a non-negative integer. If not specified, maxrows is assumed to be 0, which is interpreted as "no limit".

Examples:

READBIN(“data.bin”, “byte”) reads in the file data.bin located in the default directory as a column vector of 8-bit unsigned integers.

READBIN(“c:\mydata\final\output.bin”, “float”, 0, 5, 0, 10) reads in the file output.bin located in c:\mydata\final as a 5 column array of up to 10 rows. The data is assumed to be 32-bit floating point numbers in little-endian format, with no bytes ignored at the beginning of the file.

Notes:

  • If you are not sure whether your data is written in big-endian (the Macinstosh standard) or little-endian (the IBM-PC standard) format, please consult the system documentation for your data source before relying upon the accuracy of any result from READBIN.

  • Whenever you change the argument to this function, click on it and choose Calculate from the Tools menu to update it.


ODBC Input Component

Using the ODBC (Open Database Connectivity) Input component you can retrieve information from a database that supports SQL in its ODBC driver.

To insert an ODBC Input component into a Mathcad worksheet:

  1. Establish a link to a database.

  2. Click in a blank spot in your worksheet and choose Component from the Insert menu.

  3. Select ODBC Input from the list and click “Next.”

  4. Choose a database from which to collect data. Depending on the data source, you also may need to enter a username and password. Click “Next.”

  5. Select a table and specify the fields in the database that you would like to read. Click “Finish.”

  6. In the placeholder that appears to the left of the component, enter the name of the output variable to be defined.

Once a link to a particular database has been established, you may want to change the data source, the table, or the columns of data to be imported to your Mathcad worksheet. To do so:

  1. Right-click the component and select Properties from the pop-up menu.

  2. In the Properties dialog box under the Data Source tab, select a database, table, and columns of data.

  3. Click “OK” to close the dialog box and update your worksheet.

Notes:

  • You can change the order in which the fields of your database are stored in the columns of the output matrix in Mathcad. To do so, right-click the ODBC Input component in your Mathcad worksheet and choose Properties from the pop-up menu. Navigate to the Advanced tab of the dialog box, and rearrange the order of the fields in the columns of the matrix using the “move up” and “move down” buttons.

  • You can filter your data before bringing it into a Mathcad output variable.

  • Checking the “Show fields with unsupported data types” option in the ODBC Input component wizard or on the Data Source tab of the Properties dialog box displays all data fields, even those not supported by Mathcad variables. For example, Mathcad does not support any time data types, but you can select and display time indices from your database in a Mathcad output variable.


Data Acquisition Component

Data Acquisition Component (DAC)

You can use the Data Acquisition component (DAC) to:

  • Read data directly from a measurement device.

  • Send data to a measurement device.

  • Perform some degree of "real time" data logging and analysis.

The DAC eliminates the need to save data to an external file before importing the data into a worksheet for display and analysis, providing an interface to your measurement device directly in the worksheet.

To insert a Data Acquisition component into a worksheet:

  1. Click in a blank spot in your worksheet. If you want to send values to the component from a Mathcad variable, click below or to the right of the variable definition.

  2. Choose Component from the Insert menu.

  3. Select Data Acquisition from the list and click "Finish."

The DAC is inserted into the worksheet set for single point analog data collection and with a placeholder for one output variable. You may, however, change the number of inputs and outputs. You many also change any default properties by configuring the component, using the Edit Script window, or using the user interface for the control, shown in this example.

Notes:

  • For more information, including supported devices and the properties and methods associated with the DAC and other Scriptable Object components, see the Developer’s Reference.

  • If you are using the DAC component to bring analog waveform data into a worksheet for "real time" analysis, be sure that automatic calculation mode is turned on.

  • Example worksheets using the DAC are provided in the SAMPLES folder of your Mathcad installation.

  • Context Sensitive Help is available for all methods, properties, and events associated with the Data Acquisition control. You can access Context Sensitive Help by looking at the AnalogIO object in the Visual Basic object browser and clicking on the Help button.


Entering a Table of Numbers

You can enter data directly into your worksheet and assign it to a variable by using a data table:

  1. Click in a blank spot of your worksheet and choose Data from the Insert menu.

  2. Choose Data Table and click "OK."

  3. In the placeholder that appears to the left, enter the name of the variable to which this data will be assigned.

  4. Click in the table enter data (numbers) into the cells. You can enter any kind of decimal or e-format number such as 3.4, 2i, or 4e-6.

When you create a Data table, you’re actually creating an array with the name you entered into the placeholder. Once you’ve created an array using a Data table, you can manipulate the array however you'd like.

Notes:

  • You can only enter numbers into a table, not mathematical expressions.

  • Each row must have the same number of data values. If you do not enter a number into a cell, 0 is inserted into the cell.

  • You can paste data into a Data table if you copy the data from another application. Instead of typing data into the cells of the table, right click on the table and choose Paste Table from the pop-up menu or Import to import a file.

The table now contains the data you copied appears in the worksheet. Mathcad will attempt to preserve your data types:

  • real numbers will paste as real numbers
  • complex numbers with i or j after them will paste as imaginary
  • numbers with e or E and an exponent will be pasted as engineering notation numbers
  • strings will paste as Mathcad string variables, surrounded by quotes.


Exporting Data to a Data File

To export data to a data file:

  1. Type = to display the results of a variable.

  2. If the results display as a matrix, double-click on the matrix and use the Result Format dialog box options to change the display to "Table."

  3. Click on the output table with the right mouse button so you see a pop-up menu.

  4. Choose Export to bring up the Write to File dialog box.

  5. In the “Files of type” text box, select the format of the file you’d like to create. Use the dialog box to browse to the folder in which the data file will be created and enter the name of the data file you wish to create. Then click “Save.”

The data is exported to the file you specified.

Note: If the data changes and you want it to update in the data file, you need to export the data again. For making a live connection between your worksheet and a data file, refer to Writing Data to a Data File.


Writing Data to a Data File

To write values from your worksheet to a data file you can use the File Output component. To do so:

  1. Click in a blank spot in your worksheet.

  2. Choose Data from the Insert menu.

  3. Select File Output from the list and click “Next.” This launches the first part of the File Output Setup Wizard.

  4. From the File Format drop-down list in this Wizard, choose the type of data file you want to create.

  5. Type the path to the data file you want to write or click the “Browse” button to locate it.

  6. Press “Next.” and choose the starting and ending rows and columns from the data you wish to write to the output file.

  7. Press “Finish.” You’ll see the Input File or File Output component icon and the path to the data file.

  8. In the placeholder that appears at the bottom of the component, enter the name of the array variable containing the data which will be written to the data file.

The values in the array variable will be written to the specified filename when you click outside the component.

Notes:

  • Each time you calculate the worksheet or press F9 on the component, the data file is rewritten.

  • The variable containing the data must be an array. If your data is stored as a range variable, you must first convert the range of numbers into a vector. To do so, refer to the QuickSheet "Converting a range of numbers into a vector." If your data is from a function, the argument to your function must be an array.

  • You can also write data to files, including the contents of nested arrays, using the WRITEPRN and APPENDPRN functions.

Launch QuickSheet Example


Writing Data to a Data File (WRITEPRN function)

Writing Data to a Data File

WRITEPRN(“file”) Writes an array to file.

Arguments:

file is either the filename or the full pathname to an ASCII data file.

file is entered as a string.

Example:

WRITEPRN("c:\data\results.prn") := A

A is a matrix whose values are written to the data file results.prn located in the c:\data directory.

Notes:

  • WRITEPRN arranges the ASCII file in rows and columns like the original matrix. By default, WRITEPRN will write four significant digits in columns eight digits wide. To change this, choose Worksheet Options from the Tools menu, go to the Built-in Variables tab, and change PRNPRECISION and PRNCOLWIDTH.

  • Whenever you change the argument to this function, click on it and choose Calculate Þ Calculate Now from the Tools menu to update it.


Writing Data to a Binary Data File (WRITEBIN function)

Writing Data to a Binary Data File

WRITEBIN(“file”, “type”, endian) writes an array of scalars to the binary data file named file.

Arguments:

  • file is either a filename or the full pathname to a binary data file, and must be entered as a string.

  • type specifies the data format used in the file, and must be entered as a string. WRITEBIN supports the following data types:

    • byte - 8-bit unsigned integer.
    • double - 64-bit floating point number.
    • float - 32-bit floating point number.
    • int16 - signed 16-bit integer.
    • int32 - signed 32-bit integer.
    • uint16 - unsigned 16-bit integer.
    • uint32 - unsigned 32-bit integer.

  • endian indicates whether the data in the file is big-endian (high byte first) or little-endian (low byte-first). Big-endian is represented by a 1, while little-endian is represented by a 0.

Examples:

WRITEBIN("data.bin", "byte", 0) := A writes the array A to the file data.bin in the default directory as little-endian 8-bit unsigned integers.

WRITEBIN("c:\mydata\final\output.bin", "float", 1) := A writes the array A to the file output.bin located in c:\mydata\final\ as big-endian 32-bit floating point numbers.

Notes:

  • If you are not sure whether your data should be written in big-endian (the Macinstosh standard) or little-endian (the IBM-PC standard) format, please consult the system documentation for your data target before using WRITEBIN.

  • Whenever you change the argument to this function, click on it and choose Calculate Þ Calculate Now from the Tools menu to update it.


Copying Data to the Clipboard

If you want to send results from the worksheet to another application, but you don’t want to export them to a file, you can copy the data to the clipboard and paste it into the other application. To do so:

  1. Type = to display the results of a variable.

  2. If the results display as a matrix, double-click on the matrix and use the Result Format dialog box options to change the display to "Table."

  3. Click on the output table with the right mouse button.

  4. Choose Select All from the pop-up menu to select all the values in the output table.

  5. Click again with the right mouse button and choose Copy Selection from the pop-up menu.

  6. Open the other application and paste from the clipboard. (This is usually accomplished by choosing Paste from the Edit menu.)


Introduction to Components

Components allow data to flow dynamically between the worksheet and a data source or application. The data going into a component is called input, while the data coming out of a component is called output. The input and output are passed between a worksheet and a component by way of input variables and output variables.

The basic steps to using a component in order to exchange data with Mathcad are as follows:

  1. Insert the component and specify the input variable(s) and output variable(s) in the placeholders that appear.

  2. Configure the component so that it knows what to do with input and what to send as output.

Most components will send data to and retrieve data from another data source but some components only take input or only send output. Therefore, these steps differ slightly for each component. The ideas presented in the steps, however, should improve your understanding of how components work.

Once you have inserted a component into your worksheet, filled in the appropriate placeholders, and configured the properties, click out of the component region. The component then calculates and data exchange takes place. This happens whenever you click on the component and press [F9], when the input variables change (if automatic calculation is enabled), or when you choose Calculate Worksheet from the Tools menu.


Exchanging Data With Other Applications

Components are specialized OLE objects in your Mathcad worksheet. They allow the exchange of data with other applications or sources, and they are used to build user interface controls, such as sliders and radio buttons.

Application components give Mathcad access to functions and data from other computational applications, such as Excel, SmartSketch, and MATLAB. Unlike other kinds of OLE objects a component can:

  • Send values from Mathcad to the application.

  • Use the application to manipulate the data dynamically without actually leaving the Mathcad environment.

  • Send values from the application back to Mathcad.

When an application component is in a Mathcad worksheet, you will see a small window on that application’s environment embedded in your Mathcad worksheet (if you have that other application installed on your computer). When you double-click on the component, Mathcad’s menus and toolbars change to those of the other application. This gives you access to the application without leaving the Mathcad environment.

Mathcad components connect to the following applications:

  • Axum

  • Excel

  • MATLAB

  • ODBC databases (SQL supported)

  • SmartSketch

  • S-PLUS Graph

  • S-PLUS Script

Scriptable components

Scriptable components can be used to drive other OLE applications or control processes in your worksheet. The Data Acquisition component provides an interface between National Instruments data devices and the Mathcad environment. It allows you to send data to and retrieve data from a measurement device connected to your system. The Mathsoft Control components allow you to create buttons, comboboxes, listboxes, textboxes, and sliders that connect to variables in your worksheet. You can use the Scriptable Object component to create custom scripts that automate other OLE applications for which specialized application components are not provided.

The Developer's Reference provides detailed information about developing scriptable components.

There are additional components available in MathConnex.


Inserting a Component

To insert a component into a worksheet:

  1. Click in a blank spot of your worksheet where you would like the component.

  2. Choose Component from the Insert menu.

  3. Choose one of the components from the list and click “Next.”

Depending on the component you choose, you will immediately see the component, with some default properties, inserted into your worksheet or you will see a Wizard dialog box to help you set up the component.

Each component has its own look, so you will see something different for each component you choose. All components have one or more placeholders either to the right of the := or at the bottom of the component. For example, the Excel component might look like this when inserted into your worksheet:

The placeholders you see to the left of the := are for the output variables. The placeholder at the bottom of the component is for the name of an input variable. The number of placeholders you see to the left or the bottom depend either on the default properties for the component or on the settings you provided in the component’s Wizard. After you fill in the placeholders, you can hide the arguments if you want to.


Axum Component

If you have Axum installed, the Axum component displays publication-quality graphs created from Mathcad data right in the worksheet. Using the Axum component you can:

  • Create different types of 2D and 3D graphs using Mathcad data.

  • Use Axum to format every detail of your graph.

To insert an Axum graph into a Mathcad worksheet:

  1. Create the arrays which will provide input to the Axum component and which Axum will display in a graph. For information on the number and type of arrays required for each type of graph, see Axum’s Help.

  2. Click in a blank spot in your worksheet. Make sure you click below or to the right of the arrays.

  3. Choose Component from the Insert menu.

  4. Select Axum from the list and click “Next.” This launches the first part of the Axum Setup Wizard.

  5. Choose the type of graph you would like to insert and click “Next” to go to the next page of the Wizard.

  6. Choose a plot type. The available choices depend on the type of graph you selected.

  7. Click “Finish.” The Axum component will be inserted into your worksheet.

  8. Enter the appropriate array input variables in the placeholders that appear.

When you click outside the component, the array data will be displayed in the Axum plot type you selected in the Wizard. Each time you calculate the worksheet, the data is redisplayed in Axum.

Note:

You must have Axum 5 or higher installed on your system in order to interact with an Axum graph component.


Excel Component

Although you can import and export Excel data files using the File Input, File Output and Data Table components, you can use the Excel component to exchange data between your worksheet and Excel and use Excel’s functionality. For example, you may have some values in your worksheet that you want to send to Excel, use Excel for some manipulation, and send values back to your worksheet to continue working.

The Excel component lets you:

  • Pass data from your worksheet into an Excel file.

  • Double-click on the Excel component to use functionality from Excel.

  • Send values from an Excel file into your worksheet.

  • Specify an Excel worksheet and input and output ranges.

  • Control the number of input and output variables.

To insert an Excel component into a worksheet:

  1. Make sure Excel 7.0 or higher is installed on your system. You do not need to have Excel open in order to use the component.

  2. Click in a blank spot in your worksheet. If you want to send values to the component from a variable defined in your worksheet, make sure you click below or to the right of the variable definition.

  3. Choose Component from the Insert menu.

  4. Select Excel from the list and click “Next.” This launches the first part of the Excel Setup Wizard. Fill in the dialog box options and click on the “Next” button. The Wizard will bring you through other dialog boxes whose options you should fill in.

  5. When you finish using the Wizard, you’ll see the Excel component in your worksheet with placeholders for the input variables and output variables. Enter the input variables in the bottom placeholders. Enter the output variables into the placeholders to the left of the :=.

When you click outside the component, input variables are sent to Excel from your worksheet and a range of cells are sent from Excel back to your worksheet and assigned to output variables. Once the output variables are defined, you can manipulate them however you’d like.

Launch QuickSheet Example


MATLAB Component

Although you can import and export MATLAB data files using the File Input, File Ouput, or Data Table HREF="What_is_a_Component.html">components, you can use the MATLAB component to exchange data between Mathcad and MATLAB and use MATLAB’s functionality. For example, you may have some values in Mathcad that you want to send to MATLAB, use MATLAB to manipulate them, and send values back to MATLAB.

A MATLAB component lets you:

  • Pass values stored in variables in Mathcad into MATLAB variables.

  • Double-click on the MATLAB component to use MATLAB to process the data.

  • Send data from MATLAB variables into Mathcad variables.

To insert a MATLAB component into a Mathcad worksheet:

  1. Click in a blank spot in your worksheet. If you want to send values to the component from a Mathcad variable defined in your worksheet, make sure you click below or to the right of the variable definition.

  2. Choose Component from the Insert menu.

  3. Select MATLAB from the list and click “Next.” The MATLAB component will be inserted into your worksheet.

  4. In the placeholder that appears at the bottom, enter the name of the Mathcad input variables to pass into the MATLAB component. In the placeholder that appears to the left of the component, enter the names of the Mathcad output variables to be defined.

By default, the Mathcad input variables will be sent into MATLAB variables named in0, in1, in2, and so on. The MATLAB variables out0, out1, out2, and so on will define the output variables to be created in Mathcad. To change these names:

  1. Choose Properties from the component’s pop-up menu.

  2. Use the Outputs and Inputs tabs to type in new names for the inputs and outputs.

Note:

  • You must have MATLAB Professional version 4.2c or higher or MATLAB Student version 5.0 or higher installed on your system in order to insert a MATLAB component.

Launch QuickSheet Example


Adding Controls to a Worksheet

Mathsoft Custom Controls

The Mathsoft Controls allow you to insert buttons, text boxes, list boxes, and sliders into your Mathcad worksheet. These controls operate in a fashion similar to Microsoft Forms Controls.

Inserting a Mathsoft Control

To insert a Mathsoft Control into a Mathcad worksheet:

  1. Click in a blank spot in your worksheet. If you want to send values to the control from a Mathcad variable, click below or to the right of the variable definition.

  2. Choose Control from the Insert menu or use the Control toolbar from the View menu. Select the control you want, and it will appear in your worksheet.

  3. In the placeholder that appears to the left of the control, enter the name of the Mathcad output variable to be defined.

To add input or output variables to your control, right click on it and select Add Input Variable or Add Output Variable from the popup menu. If you add or remove input or output variables from the control, you must make changes to the script. To edit the script of a control, right click the embedded control and select Edit Script... from the popup menu. To change the appearance of the control, use the Properties dialog box for the control.

Notes:

  • For most Mathsoft Controls, you will specify outputs only. For example, if you have a TextBox control you will get 0 inputs and 1 output, the output being based on the text entered in the text box.

  • You are allowed a maximum of four inputs and four outputs for any Mathsoft Control.

  • The Developer's Reference provides more information about the properties and methods associated with Mathsoft Controls and other Scriptable Object components.


Scriptable Object Component

You can exchange data between a Mathcad worksheet and any other application that supports OLE Automation, even if Mathcad does not have a specific component to do so. You can use the Scriptable Object component to create a custom component that:

  • Sends values from Mathcad to the application.

  • Uses the application to manipulate the data without actually leaving Mathcad.

  • Sends values from the other application back to Mathcad.

You can create a custom scriptable object from any object you can insert into a Mathcad worksheet. For example, you may want to send some values from Mathcad to Lotus 1-2-3, manipulate the values there, and send results back to the Mathcad worksheet.

To create a Scriptable Object component, you must:

  • Be proficient in a supported scripting language that is installed on your system.

  • Have some knowledge of the way the other application has implemented OLE.

  • Have the other application available on your system.

To insert a Scriptable Object component into a Mathcad worksheet:

  1. Click in a blank spot in your worksheet. If you want to send values to the object from a Mathcad variable, make sure you click below or to the right of the variable definition.

  2. Choose Component from the Insert menu.

  3. Select Scriptable Object from the list and click “Next.” This launches the Scriptable Object Setup Wizard.

  4. The Object to Script scrolling list shows the available applications on your system.

  5. Specify whether the component will be a new file or whether you will insert a file that already exists, and whether you will see the actual file in your Mathcad worksheet or if you’ll see an icon. Click on the “Next” button.”

  6. Specify which scripting language you will use, the type of object you want to script, the name of the object, and the number of inputs and outputs the object will accept and provide.

When you finish using the Wizard, you’ll see a scriptable component in your worksheet with placeholders for the input and output variables. Enter the input variables in the bottom placeholders. Enter the output variables into the placeholders to the left of the :=.

The final step is the script the component. Then you’ll have a scripted object in your worksheet.

The Developer's Reference provides more information about the Scriptable Object component, or see the MathConnex online Help.

You can exchange data between a Mathcad worksheet and any other application that supports OLE Automation, even if Mathcad does not have a specific component to do so. The Scriptable Object component allows you to:

  • Send values from Mathcad to the application.

  • Use the application to manipulate the data without actually leaving Mathcad.

  • Send values from the other application back to Mathcad.

Note:

Mathcad can protect you from potentially damaging code within Scriptable Object components. By default, you are prompted to enable or disable evaluation of scriptable components upon opening a worksheet containing them. The security level can be set on the Script Security tab of the Preferences dialog.

Launch QuickSheet Example


S-PLUS Graph Component

S-PLUS is a sophisticated exploratory data analysis and statistical application available from Insighful. The S-PLUS Graph component is an embedded S-PLUS graph sheet that allows you to integrate a wide range of two- and three-dimensional graphs into your Mathcad worksheet.

To insert an S-PLUS Graph component into a Mathcad worksheet:

  1. Create the array(s) which will provide input to the S-PLUS Graph component.

  2. Click in a blank spot in your worksheet below or to the right of array(s).

  3. Choose Component from the Insert menu.

  4. Select S-PLUS Graph from the list and click “Finish.”

  5. The S-PLUS Graph component is inserted into your worksheet. By default the component is inserted with a placeholder for a single input variable.

  6. Place the array name(s) into the placeholder.

A default graph is created but you can choose another graph type if necessary.

Note:

  • You must have S-PLUS 4.5 or higher installed on your system in order to insert an S-PLUS Graph component.


S-PLUS Script Component

S-PLUS is a sophisticated exploratory data analysis and statistical application available from Insightful. The S-PLUS Script component allows you to write and execute S-PLUS 4.5 or higher programs and link them to other computations in Mathcad.

To insert an S-PLUS Script component into a Mathcad worksheet:

  1. Click in a blank spot in your worksheet below or to the right of any input variable definitions.

  2. Choose Component from the Insert menu.

  3. Select S-PLUS Script from the list and click “Finish.” The S-PLUS script component appears as an empty box containing the words “S-PLUS Script.”

  4. In the placeholder that appears at the bottom, enter the name of the Mathcad input variable to pass into the component.

  5. In the placeholder that appears to the left of the component, enter the name of the Mathcad output variable to be defined.

  6. Enter the script.

By default, the Mathcad input variables will be sent into the component as variables named in0, in1, in2, and so on. The S-PLUS variables out0, out1, out2, and so on will define the output variables to be created in Mathcad. To change these names:

  1. Click on the component with the right mouse button and choose Properties from the component’s pop-up menu.

  2. Use the Outputs and Inputs tabs to type in new names for the inputs and outputs.

Note:

  • You must have S-PLUS 4.5 or higher installed on your system in order to insert an S-PLUS Script component.

Launch QuickSheet Example


SmartSketch Component

SmartSketch is a 2D drawing and design tool developed by Intergraph. The SmartSketch component allows you to create in a Mathcad worksheet SmartSketch drawings whose dimensions are computationally linked to your Mathcad calculations. For example, your Mathcad equations can drive the size or shape of a drawing. The SmartSketch component makes Mathcad the ideal platform for creating technical illustrations and specification-driven designs.

To insert a SmartSketch component into a Mathcad worksheet:

  1. Click in a blank spot on your worksheet. If you want to send values to the drawing from a Mathcad variable defined in your worksheet, click below or to the right of the variable definition.

  2. Choose Component from the Insert menu.

  3. Select SmartSketch from the list, and click "Next". The first page of the SmartSketch component Wizard appears.

To insert a SmartSketch drawing you've already created, choose "From Existing File", and type the path name in the text box or use the Browse button to locate the file; then click "Open". Otherwise, choose "New SmartSketch Document". The next page of the Wizard appears.

  1. Specify the number of inputs and outputs. If you are using an existing file, also specify the names of the variables, dimensions, or symbols in the drawing to send input to and retrieve output from. Use the drop-down menus in the text boxes next to each input and output.

  2. Click "Finish" and the SmartSketch component appears in your worksheet with placeholders for the input variables and output variables.

  3. Enter the names of Mathcad input variables in the bottom placeholders. Enter the output variables in the placeholders to the left of the :=.

Notes:

  • Input values that do not have units attached are passed in SI units. For example, if you send 2.0 as input for a length, it is assumed to be 2.0 meters. SmartSketch, by default, converts this to the display units (inches by default) and creates the drawing.

  • You can use the SmartSketch component if you have installed SmartSketch LE, SmartSketch version 3 or higher, Imagination Engineer, or Imagineer Technical version 2.

Launch QuickSheet Example


Saving and Redistributing Components

Once you have scripted an object to your liking, you can save it as a customized Scripted Object component for future use. The scripted object will be saved as an MCM file and, once registered, it will be available every time you start Mathcad. You can share any MCM file you have created with other Mathcad users.

Saving Scripted Objects as customized components

To save a Scripted Object as a customized component:

  1. Create a Scripted Object component in your Mathcad worksheet.

  2. Right-click on the component and choose Export as Component from the pop-up menu.

  3. Specify the name of the component, as you would like it to appear on the Insert Component list, and provide a file name. Click "Next."

  4. Enter a password to prevent others from editing the script of the component and verify the password. Click "Finish" to save the component. This step is optional.

Once you have exported your component, which saves the component information in an MCM file, it automatically becomes available on your system. The component will appear in the Insert Component list.

Using custom components you have received

To start using a component defined in an MCM file you have received:

  1. Copy the MCM file to the MCM folder of your Mathcad installation.

  2. Double-click the MCM file to register it with Mathcad.

  3. Start Mathcad and the customized component defined in the MCM file will appear on your Insert Component list.

Note:

  • If you are using a customized component provided to you by someone you must also have the embedded control installed on your computer. If you experience errors inserting the customized component most likely you do not have the embedded control on your system. In this case, contact the provider of the customized component to obtain the control file.


MathConnex

The components available in Mathcad are used to connect a Mathcad worksheet to other data sources and applications. If you want to connect these data sources and applications to each other as well as to Mathcad, you can use the MathConnex application.

In addition to the components available in Mathcad, MathConnex contains a number of other components for manipulating data, such as a Mathcad component for connecting to a Mathcad worksheet. The MathConnex environment lets you connect any of one of the available components to any other component. You can visually design systems of data flow to analyze projects that involve a variety of applications and data sources.

You can run MathConnex as you would any application. Simply double-click the executable file (MathConx.exe) from your installation of MathConnex or use the start menu to browse for the application.


Mathcad as an OLE Automation Server

Mathcad as an Automation Server

Mathcad’s Automation Interface provides a way to use Mathcad as an OLE Automation server from within another Windows application, including Mathcad itself. Using Mathcad’s Automation interface, you can:

  • Send data dynamically to Mathcad from another application.

  • Use Mathcad to perform calculations or other data manipulations.

  • Send results back to the original application.

The basic steps to using Mathcad as an OLE Automation server are as follows:

  1. Insert a Mathcad Document as an OLE object into an Automation client.

  2. Set up data to pass to Mathcad and/or places to put data retrieved from Mathcad.

  3. Write a program using the client application to define and retrieve variables in the Mathcad Document object.

Notes:

  • The Automation Interface supersedes the DDE interface supported in Mathcad 5 and 6.

  • See the Developer's Reference under the Help menu for more information about the Automation Interface.


Statistics and Data Analysis

Data analysis functions

Describes data analysis functions such as mean, variance, standard deviation, kurtosis, and correlation.

Distribution functions

Describes the built-in gamma function, the error function and the cumulative normal distribution and many other probability distribution functions.

Random numbers

Describes how random numbers are generated and how to use them to generate random numbers having a variety of distributions.

Histograms

Describes how to get the frequency distribution of a data sample.

Combinatorical analysis

Functions for counting permutations and combinations.

Interpolation and prediction

Describes linear and cubic spline interpolation, and linear prediction.

Smoothing

Describes a variety of methods for smoothing noisy data.

Curve fitting

Describes regression techniques, both linear and nonlinear.


Data Analysis Functions

cvar(A,B)

Covariance of elements in the two m x n arrays A and B.

corr(A,B)

Pearson's correlation coefficient for the two m x n arrays A and B.

gcd(A,B,C,...)

Greatest common divisor of A, B, C, ...

gmean(A,B,C,...)

Geometric mean of A, B, C, ...

hmean(A,B,C,...)

Harmonic mean of A, B, C, ...

kurt(v)

Kurtosis of the elements in v.

lcm(A,B,C,...)

Least common multiple of A, B, C, ...

mean(A,B,C,...)

Arithmetic mean of A, B, C, ...

median(A,B,C,...)

Median of A, B, C, ...

mode(A,B,C,...)

Mode of A, B, C, ...

skew(v)

Skewness of elements of v.

stdev(A,B,C,...) or Stdev(A,B,C,...)

Standard deviation of a population of values A,B,C,...

var(A,B,C,...) or Var(A,B,C,...)

Variance of a population of values A,B,C,...

Launch QuickSheet Example


Density and Distribution Functions

Functions for working with common probability densities fall into the following classes:

Probability densities

These give the likelihood that a random variable will take on a particular value.

Cumulative probability distributions

These give the probability that a random variable will take on a value less than or equal to a specified value. These are obtained by simply integrating (or summing where appropriate) the corresponding probability density over an appropriate range.

Inverse cumulative probability distributions

These functions take a probability as an argument and return a value such that the probability that a random variable will be less than or equal to that value is whatever probability you supplied as an argument.

Choose from the following distributions:

beta

binomial

cauchy

chi squared

exponential

F

gamma

geometric

hypergeometric

log normal

logistic

negative binomial

normal

poisson

student's t

uniform

weibull

Launch QuickSheet Example


Random Number Generators

The random number generators listed below use a seed value to generate a sequence of quasi-random numbers. To generate a different sequence of random numbers, go to the Tools menu, click Worksheet Options, and change the seed value on the Built-in Variables tab, or use the Seed function in your worksheet.

Each distribution listed has a probability density, a cumulative probability distribution, and inverse cumulative probability distribution, and a random number generator associated with that distribution.

beta

binomial

cauchy

chi squared

exponential

F

gamma

geometric

hypergeometric

log normal

logistic

negative binomial

normal

poisson

student's t

uniform

weibull

Launch QuickSheet Example


Curve fitting functions

Regression - Curve Fitting Functions

Linear regression

slope(vx,vy) and intercept(vx,vy)

These functions find the slope and the intercept of a set of data points.

line(vx,vy)

Finds the coefficients for a line that best approximates the data in vectors vx and vy.

medfit(vx,vy)

Finds the coefficients for a line that best approximates the data in vectors vx and vy using median-median regression.

Polynomial regression

regress(vx,vy,k)

Finds the polynomial that best fits a set of data points.

loess(vx,vy,span)

Finds the set of second order polynomials that best fit particular neighborhoods of data points.

Multivariate polynomial regression

regress(Mxy,vz,k)

Finds the polynomial surface that best fits a set of points.

loess(Mxy,vz,span)

Finds the set of second order polynomials that best fits a particular neighborhoods of data points.

Specialized regression

expfit(vx,vy,[vg])

Finds the coefficients for an exponential curve that best approximates the data in vx and vy. vg (optional) contains guess values for the three coefficients.

lgsfit(vx,vy,vg)

Finds the coefficients for a logistic curve that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

sinfit(vx,vy,vg)

Finds the coefficients for a sine curve that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

logfit(vx,vy,vg)

Finds the coefficients for a logarithmic curve that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

lnfit(vx, vy)

Finds the parameter values for the logarithmic curve that best approximates the data in vx and vy. A vector of guess values is not required.

pwrfit(vx,vy,vg)

Finds the coefficients for a power curve that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

Generalized regression

linfit(vx,vy,F)

Finds the coefficients that make a linear combination of functions best fit a set of data points.

genfit(vx,vy,vg,F)

Finds the parameters that make a function you specify best fit a set of data points.


Smoothing Data

Smoothing involves taking a set of y (and possibly x) values and returning a new set of y values that is smoother than the original set.

medsmooth(vy,n)

Returns an m-element vector created by smoothing vy with running medians over a window of width n.

ksmooth(vx,vy,b)

Returns an m-element vector created by smoothing using a Guassian kernel to return weighted averages of the elements in vy.

supsmooth(vx,vy)

Returns an m-element vector created by the piecewise use of a symmetric k-nearest neighbor linear least square fitting procedure in which k is adaptively chosen.


Interpolation and Prediction

There are four interpolation methods and one linear prediction method:

  • Linear interpolation: For connecting points with a straight line.

  • Cubic spline interpolation: For connecting points with a cubic section.

  • B-spline interpolation: For connecting points with polynomials of a specified degree at given knots.

  • Multivariate cubic spline interpolation: For creating a surface which passes through a grid of points.

  • Linear prediction: For determining values beyond a set of data.


X-Y Plots

X-Y plots are useful for plotting functions, mathematical expressions, and sets of data (stored in vectors).

Once you’ve created an X-Y plot, you can format it to your liking. You can also zoom in on X-Y graph or extract the coordinates from a particular spot.

For more details:

Creating a plot

Graphing more than one expression

Graphing data

Changing the size of a plot

Axis limits

Axis settings

Axis labels

Trace settings

Legends

Zooming in

Reading coordinates

Titles on plots

Default settings

Animating an X-Y plot


Polar Plots

Use polar plots to plot angle-dependent mathematical expressions, functions, and sets of data (stored in vectors). Once you've created a polar plot, you can format it to your liking. You can also zoom in on parts of a polar plot or extract the coordinates from a particular spot.

Creating a plot

Graphing more than one expression

Graphing data

Changing the size of a plot

Axis limits

Axis settings

Trace settings

Legends

Zooming in

Reading coordinates

Titles on plots

Default settings

Animating a polar plot


3D Plots Overview

You can create the following kinds of plots to represent three-dimensional data:

Surface

Parametric Surface

Contour

3D Scatter

3D Bar Plot

Vector Field

You can format them however you like or rotate, spin, or zoom in on them. You can also create more than one 3D plot on the same graph or graph any of the uniform polyhedra.


Surface Plots

A surface plot is the visual representation of a matrix of data as a surface in a three dimensional graph. The graph can be formatted in many ways to control its appearance. You can also change a surface plot into another type of 3D plot.

For more information:

    • Creating a surface plot

    • Parametric surface plots

    • Color settings

    • Line settings

    • Point settings

    • Axis settings

    • Backplane settings

    • Lighting settings

    • Advanced view settings

    • Zooming

    • Rotating or spinning

    • Annotating a 3D Plot


Contour Plots

Contour plots require a matrix of values, which are linearly interpolated to form level curves. Level curves can represent isotherms, isobars, equipotentials, streamlines, and many other physical phenomena. You can format a contour plot in many ways to control its appearance. You can also change a contour plot into another type of 3D plot.

For more information:

  • Creating a contour plot

  • Viewing the x or y contours

  • Color settings

  • Line settings

  • Point settings

  • Axis settings

  • Backplane settings

  • Lighting settings

  • Advanced view settings

  • Zooming

  • Rotating or spinning

  • Annotating a 3D Plot

Launch QuickSheet Example


3D Bar Plots

Three-dimensional bar plots allow you to visualize a matrix of data as bars of varying heights. You can format the plot in many ways to control its appearance. You can also change a 3D bar plot into another type of 3D plot.

For more information:

  • Creating a 3D bar plot

  • Bar layout settings

  • Color settings

  • Line settings

  • Point settings

  • Axis settings

  • Backplane settings

  • Lighting settings

  • Advanced view settings

  • Zooming

  • Rotating or spinning

  • Annotating a 3D Plot


3D Scatter Plots

Three-dimensional scatter plots allow you to visualize x, y, and z coordinates in space. This makes them useful for drawing parametric curves or for observing clusters of data in 3D space. You can control the symbol and color used for representing the data points and whether the points are connected with a line. You can also change a 3D scatter plot into another type of 3D plot.

For more information:

  • Creating a 3D scatter plot from a function

  • Creating a 3D scatter plot from 3 data vectors

  • Creating a 3D scatter plot from a matrix of data values

  • Creating a space curve

  • Point settings

  • Line settings

  • Axis settings

  • Backplane settings

  • Lighting settings

  • Advanced view settings

  • Zooming

  • Rotating or spinning

  • Annotating a 3D Plot

Launch QuickSheet Example


Vector Field Plots

A vector field can be thought of as a function which assigns a vector, starting at a given point, to a point in the plane . You can create a two-dimensional vector field plot by creating a matrix of complex numbers. The base of each vector sits on the x and y values corresponding to the rows and columns of the matrix. The magnitude and direction of each vector are derived from the real and imaginary parts of the matrix elements.

For more information:

    • Creating a vector field plot

    • Color settings

    • Line settings

    • Point settings

    • Axis settings

    • Backplane settings

    • Lighting settings

    • Advanced view settings

    • Zooming

    • Rotating or spinning

    • Annotating a 3D Plot


Graphing Multiple 3D Plots

To graph more than one 3D plot on the same graph:

  1. Define the arguments (matrices or vectors) needed for the plots you want to graph.

  2. Choose Graph from the Insert menu. Choose the kind of 3D graph you want to create first.

  3. In the placeholder of the 3D plot operator, enter the arguments for the first 3D plot.

  4. Type a comma.

  5. Enter the arguments for the next 3D plot.

  6. Continue entering arguments separated by commas. If any of the 3D plots requires more than one argument, enclose it in parentheses.

  7. Press [Enter] or click outside the plot region.

  8. Double-click on the graph to open the 3D Plot Format dialog box. Use the Display As section and the Plot 1, Plot 2, etc. tabs to specify how each set of arguments should be displayed.


Overview of Symbolic Calculation

Use symbolic math when you want the answer to a problem to be something other than a number. For example, you may want to solve an equation for the variable x in terms of y without defining y numerically.

There are two ways to do symbolic math:

  1. Use the symbolic equal sign for live symbolic results.

  2. Use menu commands from the Symbolics menu.

Deciding which method to use depends on whether you want live symbolic results. If you want to evaluate an expression symbolically using numerical definitions you made in your worksheet, use the symbolic equal sign. Otherwise, use the menu commands on the Symbolics menu.

The following can be performed symbolically:

  • Algebra

  • Calculus

  • Solving

  • Matrix manipulations

  • Transforms

  • Most any operation using an operator or function


Symbolic Evaluation using Menu Commands

One way to evaluate an expression symbolically is to use the commands from the Symbolics menu. Using the Symbolics menu, all algebraic transformations work in fundamentally the same way:

  1. Select either all or part of an expression.

  2. Choose the appropriate menu command from the Symbolics menu.

You see the transformed expression in your worksheet. Depending on how you've set your evaluation style, this transformed expression will either replace the expression you clicked on or place it below or to the right of the existing one. If the symbolic transformation was unsuccessful, the new expression will be identical to the old one.

Note:

  • All variables and expressions are assumed to be real. If you want to assume they are complex, use live symbolic evaluation using the "complex" keyword.

  • When you use the menu commands to do symbolic math, the resulting transformation does not update itself when you make changes to your worksheet. To do symbolic math so that the transformations update, use live symbolic evaluation.


Live Symbolic Evaluation Using the Symbolic Equal Sign

Use the symbolic equal sign to symbolically evaluate an expression. To do so:

  1. Type the expression you want to evaluate symbolically.

  2. Press [Ctrl]. to insert the right arrow known as the symbolic equal sign.

  3. Press Enter.

By default, the symbolic equal sign returns the same expression as that returned by choosing Evaluate Symbolically from the Symbolics menu, but it takes other definitions in your worksheet into account. You can, however, change the meaning of the symbolic equal sign by modifying it with a keyword.

Launch QuickSheet Example


Modifying the Live Symbolic Operator

If you need to symbolically evaluate an expression in a particular way, use a keyword to modify the live symbolic operator. To do so:

  1. Type the expression you want to evaluate symbolically.

  2. Press [Ctrl][Shift]. to insert a placeholder and the symbolic equals sign.

  3. Type a keyword in the placeholder or choose a keyword from the Symbolic toolbar. If the keyword takes a modifier, type a comma followed by the modifier. If there is more than one, type them separated by commas.

  4. Press Enter.

The symbolic processor returns a result based on the keyword you typed. You can symbolically evaluate this result further by using several keywords.

Launch QuickSheet Example


Symbolic Algebra

Simplifying

Expanding expressions

Factoring

Collecting terms

Finding the coefficients of a polynomial

Series

Partial fractions

Symbolic sums and products


Symbolic Calculus

Symbolic Derivatives

Symbolic Integrals

Limits


Solving Equations Symbolically

Solving an Equation Symbolically

Solving a System of Equations Symbolically


Symbolic Matrix Manipulation

Matrix operations

Transpose of a matrix

Inverse of a matrix

Determinant of a matrix


Symbolic Transforms

Overview

Fourier transforms

Laplace transforms

z -Transforms

Inverse Fourier

Inverse Laplace

Inverse z


Using Functions and Variables in Symbolic Math

Built-in functions

Many built-in functions retain their usual meanings in symbolic calculation. Certain built-in functions do not have any reasonable meaning in the symbolic context and are therefore not evaluated. For example, statistical functions like linterp, or rnd make no sense symbolically.

Predefined constants

The symbolic processor recognizes p, e, and [image] because these have a well-accepted mathematical meaning. Other predefined constants such as TOL and ORIGIN have no such meaning and are not evaluated.

User-defined functions and variables

The symbolic processor recognizes user-defined functions and variables only if you are evaluating them with the symbolic equal sign.


Units and Dimensions, an Overview

Overview of Units and Dimensions

A complete set of units is available for your calculations. You can attach these built-in units to your variables or define and attach your own units. Your worksheet checks for dimensional consistency and automatically displays results in terms of the appropriate units for the unit system you’ve chosen.

    • List of built-in units

    • Inserting built-in units

    • Attaching units to a variable

    • Unit conversions

    • Formatting units

    • Simplifying units

    • Choosing a system of units

    • Renaming dimensions

    • Defining a new unit


List of Built-In Units

Built-In Units

This is a list of all built-in units available. All except those underlined are available in either the SI, MKS, CGS or US systems. You can see a list of currently available units in the Insert Unit dialog box by choosing Unit from the Insert menu.

A

acre

amp

atm

bhp

Bq

BTU

BTU15

c

C

cal

cal15

cal20

CBTU

cd

cm

coul

day

dcal

deg

dyne

ehp

erg

F

farad

fl_oz

ft

g

gal

galUK

gauss

GHz

gm

Gy

H

hectare

henry

hhp

hp

hpUK

hr

Hz

Hza

IBTU

in

in_Hg

J

joule

K

K

kA

KA

kcal

kg

kgf

kHz

KHz

km

kph

kV

KV

kW

L

lb

lbf

liter

lm

lx

m

mBTU

mcal

mA

mg

mH

mho

MHz

mi

min

mL

mm

mole

mph

mV

N

newton

nF

W

Oe

oersted

ohm

oz

Pa

pF

poise

psi

R

rad

S

s

sec

siemens

slug

statamp

statcoul

statfarad

stathenry

statohm

statseimens

stattesla

statvolt

statweber

stokes

str

Sv

T

tBTU

tcal

tesla

ton

tonne

torr

V

volt

W

watt

Wb

weber

yd

yr


Inserting Built-In Units

Inserting a Built-in Unit

An easy way to insert a built-in unit is to use the "Insert Unit" dialog box. To do so:

  1. Choose Unit from the Insert menu to open the Insert Unit dialog box.

  2. Find the unit you want to use in the scrolling list of units on the right. To display only those units corresponding to a particular physical quantity, use the scrolling list on the left.

  3. Once you've found the unit name, double-click on it.


Associating a Unit with a Variable or Constant

To associate a unit with a variable or constant, simply multiply it by the name of the unit. Click on the buttons below for a step-by-step example:

  1. Click in the variable or constant.

  2. Press * to insert the multiplication symbol and a placeholder.

  3. Type the name of any unit in the placeholder or choose Unit from the Insert menu.

When you enter units in the units placeholder, Mathcad divides the value to be displayed by whatever you enter in the placeholder. This ensures that the complete displayed result - the number times the expression you entered for the placeholder - is a correct value for the equation.


Unit Conversions

Your worksheet automatically displays results in terms of the fundamental units for whatever unit system you’ve chosen. However, you can re-display a particular result in terms of any of the built-in units.

The example below shows how to convert a single result into units other than the fundamental units. It assumes the result already has units. If the result doesn't have units, there won't be any meaningful way to convert units. You'll need to attach units to whatever expression gives the result. Click on the buttons below to see a step by step example of how to convert units.

  1. Click in the result to see the unit placeholder.

  2. Click on the unit placeholder.

  3. Type any combination of units in the unit placeholder, or choose Unit from the Insert menu and click on a unit from the list that appears.

  4. Click outside the expression to re-display the result in terms of the selected units.

Launch QuickSheet Example


Formatting Displayed Units

To display a unit result more neatly in fractional form:

  1. Double-click on the unit to bring up the Result Format dialog box.

  2. Click on "Format units" so it becomes checked.

  3. Click "OK."

Example:

Becomes the following when formatted:

Note: If you want to automatically simplify all the units in a worksheet, click "Set as default" in the Result Format dialog box before clicking "Format units."


Choosing a System of Units

Unless you specify otherwise, you'll see your results displayed in terms of the fundamental SI units: m, kg, s, K, A, cd, and mole. To choose a different system of units:

  1. Choose Worksheet Options from the Tools menu and go to the Unit System tab.

  2. Click on the whatever default system of units you want to use.

If you set the unit system to None, you can still define and use your own units. To do so, define your own units in terms of the special built-in constants 1L, 1M, 1T, 1Q, 1K, 1C, and 1S which represent the dimensions length, mass, time, charge or current, absolute temperature, luminosity, and substance. For example, you can define kg:=1M, sec:=1T, and m:=1L.

Launch QuickSheet Example


Defining a Unit

Since you already have a collection of built-in units, you'll rarely need to define your own. You can, however, define a unit just as you would define a variable:

1. Type the name of the unit you want to define. Example:

2. Press ":" to insert the ":=" Example:

3. In the placeholder, type the unit or combination of units you want your new unit to be defined as. Example:

After you've done all this, the new unit will be available everywhere below and to the right of where you defined it.

Launch QuickSheet Example


Renaming Dimensions

By default, results are displayed in terms of m, kg, s, A, K, cd, and mole. To change this to something like meter, kilo, s and degrees:

  1. Choose Worksheet Options from the Tools menu and click on the Dimensions tab.

  2. Click on the “Display dimension names” checkbox.

  3. Type the desired dimension names in place the names in the text boxes and click OK.

Renaming the dimensions may be useful when you prefer to use more appropriate names for your work. For example, a car salesman might define trucks and sedans rather than length and mass. In short, a dimension is nothing more than a way of tagging numbers so you can keep better track of them.


What is a Program?

A program is simply an expression made up of more than one statement. Shown below are a single expression and the same expression written as a program:

Despite the underlying equivalence between programs and simple expressions, programs offer two distinct advantages:

  • When you use control structures like loops and conditional branches, a program can become far more flexible than a simple expression could ever be.

  • A program made of several simple steps is often much easier to create than an equivalent, but far more complicated expression draped with parentheses.


Conditional Statements

Use a conditional statement whenever you want a program statement to execute only upon the occurrence of some condition. To insert a conditional statement:

  1. Click on the placeholder into which you want to place the conditional statement

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click the if button or press [Shift] + ]. Do not just type the word "if"

  4. In the right placeholder, type a boolean expression

  5. Click the Add Line button to insert placeholders for additional statements if necessary

  6. Click in the remaining placeholder and click the otherwise button. Do not just type the word "otherwise"

  7. In the remaining placeholder type the value you want the program to return if the condition is false

Note:

If you use more than one if statement before an otherwise statement, the otherwise statement is executed only when all the conditions are false.

Launch QuickSheet Example


break Operator

Use a break operator in a loop whenever you want to halt execution of the loop and return control to the first statement after the loop. If a break occurs at the top level of a program, it behaves similarly to a return, except that it returns the result of the last executed statement.

To insert a break operator:

  1. Click in the placeholder in which you want to put the break operator.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the break button or press Ctrl + {. Do not just type the word "break".

Launch QuickSheet Example


Program Loops

A loop is a program statement that causes one or more statements (the body of the loop) to execute repeatedly until a particular condition occurs. There are two kinds of loops:

  • "For" loops are useful when you know exactly how many times the body of the loop should execute.

  • "While" loops are useful when you want to stop execution upon the occurrence of a condition but you don't know exactly when that condition will occur.

When using loops, you may need to break out of them or control particular iterations.


Returning a Value from a Program

By default, a program returns whatever is on the last line. However, you can return a value located elsewhere in the program by using the return operator.

To insert a return operator:

  1. Click on the placeholder into which you want to place the return operator.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the return button or press [Ctrl] + |. Do not just type the word "return".

  4. In the placeholder to the right of the "return", type whatever you would like to return.

Return statements are useful when you want to return a value from a particular loop, or when debugging a program.


Trapping Errors in a Program

To return an alternative value when an error is encountered in an expression, use the on error operator:

  1. Click on the placeholder into which you want to place the on error operator.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the on error button or press [Ctrl] + '. Do not just type the words "on error".

  4. In the placeholder to the right of "on error", type the expression you would like to evaluate.

  5. In the placeholder to the left of "on error", type whatever you would like to return if the default return expression cannot be evaluated. Use the Add Line button to insert placeholders for additional statements if necessary.

  6. The right-hand expression is evaluated and returned if no errors occur. If an error occurs, the left-hand argument is returned.


Evaluating a Program Symbolically

Once you’ve defined a program that you want to evaluate symbolically:

  1. Type the name of the function or variable name which is defined in terms of a program.

  2. Press Ctrl +Period to insert the right arrow representing the symbolic equal sign.

Note:

A program can only be evaluated symbolically if it does not involve units. If a program evaluates using units, it should not be evaluated symbolically.


Overview of Animation

Animation can be a very useful tool for studying numeric output both directly and visually. You can create animations by using a variable called FRAME in your equations. A video is created by shooting a sequence of snapshots or frames. A frame is generated, one at a time - in order, for each value of FRAME in the specified range.

Creating an animation

Playing back an animation

Saving an animation


Creating an Animation

You can animate any region that depends on the variable FRAME. To do so:

  1. Create a region whose appearance depends on FRAME.

  2. Make sure your worksheet is in automatic mode.

  3. Choose Animation from the Tools menu to open the Animate dialog box.

  4. Enclose the region(s) you want to animate in a selection rectangle.

  5. In the dialog box, specify starting and ending values of FRAME.

  6. Click "Animate."

You’ll see a miniature rendition of your selection inside the dialog box. This is redrawn once for each value of FRAME. This won’t necessarily match the playback speed since at this point, you’re just creating the animation, you’re not playing it back yet.

Note:

When animating a plot, it's best to set the axis limits yourself instead of letting them be set automatically. If you don't do this, the axis limits get reset at every frame in the animation. The result: a movie in which the axis limits and not the plot change from one frame to the next.


Playing Back the Animation

Once you've created the animation, you'll see the first frame of your animation in the animation player. You can now:

  • Play back the whole animation by clicking on the playback button, or

  • See one frame at a time by using the slider.


Saving an Animation

Once you've created an animation, you can save it. This will allow you to play it later without having to re-record it. To save the animation as a Windows AVI file:

  1. Make sure the Animate dialog box is open. (Choose Animation from the Tools menu to open it.)

  2. Make sure that the first frame of the animation you want to save is shown in the dialog box.

  3. If necessary, change the compression method used to save files by clicking the Options button.

  4. Click the "Save as" button.


Playing Back a Saved Animation

To playback a previously saved animation (or any Windows AVI file):

  1. Choose Animation from the Tools menu to bring up the Playback window.

  2. Click the [image] button.

  3. Choose Open from the menu.

  4. Double-click on the name of the animation you want to open.

  5. Play back the whole animation by clicking on the playback button, or

  6. See one frame at a time by using the slider.


Importing Graphics

Overview of Importing Graphics

Although you cannot draw pictures in your worksheet, you can import almost any graphic created in another application. You can import a graphic as a bitmap or as an OLE object. Image processing functions provide ways to import a graphics image as a matrix, manipulate it, and export it as a graphics image file.

Working with bitmaps

Importing from the clipboard

Importing a picture from a file

Working with a picture

Framing a bitmap

Changing the size of a bitmap

Restoring a bitmap to its original size

Working with OLE objects

Importing an object by dragging and dropping

Importing from the clipboard

Inserting an object directly

Editing an object

Image Processing

Overview of image processing


Image Processing

Image processing can be broken down into four steps:

Reading the image into a matrix...

Performing mathematical transformations on the matrix...

Displaying the resultant image...

Saving the image...


Mathcad E-books and Extension Packs

The Mathsoft series of E-books and Extension Packs give you live, interactive access to information and additional functions. They cover specific topics in a variety of fields ranging from Civil Engineering, Electrical Engineering, Signal Processing, Image Processing, and Math topics.

Mathcad E-books and Extension Packs have features that make them especially useful when you’re working with Mathcad:

  • Every page is a live worksheet so you can change values and calculate results.

  • You can copy and paste data and formulas into your own Mathcad worksheet.

  • If you double-click on a section title or index entry, the appropriate section opens. You can also browse the book page by page or section by section.

  • You can search electronically the text.

  • You can make changes and have the option of saving them.

To find out more about the many E-books and Extension Packs available from Mathsoft, go to the Mathsoft Webstore at http://webstore.mathsoft.com or download some of the free E-books in the Mathcad library at http://www.mathcad.com/library/.


Opening an E-book

To open an E-book or Extension Pack:

  1. Choose Open from the File menu.

  2. Set the “Files of Type” box to “Mathcad Books (*.hbk).”

  3. Browse to find one of the available Electronic Books or Extension Packs you have installed, or type the name of an Electronic Book or Extension Pack.

The E-book or Extension Pack opens in a separate window. Use the toolbar in the window to navigate.

Note:

You do not have to have an Extension Pack open in order to use the functions or features it supplies. Once an Extension Pack is installed, the functions are always available.


E-book Toolbar

The E-book toolbar buttons let you move around, and find, copy, print, and save pages in an E-book. You can also browse to any file on the World Wide Web.

To learn what a button does, allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Browsing Through an E-book

There are two ways to move through an E-book:

  • Use the arrow buttons on the Book toolbar along the top of the window. The blue arrow buttons allow you to move through the book in order. The yellow buttons move you to the files you last looked at. The house button takes you to the start page of the book, often a table of contents. The binocular (Search) button allows you to search throughout the book for specific words.

  • Click on hyperlinked regions to open pop-up windows or move to another file. Hyperlinked text is generally underlined. You will see the cursor change to a small hand as you hover over hyperlinks.


Searching Through an E-book

The table of the contents for an electronic book can be reached by choosing the House button in the E-book toolbar along the top of the Book window.

You can also search for every occurrence of a text string:

  1. Click the Search button in the Electronic Book toolbar.

  2. Type the text in the Search text box. As you type, the scrolling list displays words that closely match the letters you type.

  3. Click the Search button. Mathcad shows the sections that have those words indexed.

  4. To open a section, click on its title in the Found list and click on the Go to Section button.

  5. The Next button will take you to the next occurrence of the text. This button grays out when you reach the last entry.

  6. Clicking the Previous button scrolls back to previous entries.


Copying Information from an E-book

To copy a page from an E-book to your worksheet:

  1. Click on the Copy button on the E-book toolbar.

  2. Click in the main worksheet window.

  3. Choose Paste from the Edit menu.

To drag a region from an E-book to your worksheet:

  1. Select the region(s) you want to move.

  2. Move the mouse pointer into one of the regions enclosed by a dashed selection rectangle. The pointer will turn into a small hand.

  3. Hold down the mouse button and drag the regions from the E-book to the worksheet.

  4. When the regions are on the desired spots, let go of the mouse button.


Making Notes in an E-book

You can make changes in an E-book just as you can in any Mathcad worksheet. However, any changes you make are usually lost when you close the book.

To save your changes, choose Annotate Book from the Book menu. When you do so:

  • Any changes you make are highlighted in a different color.

  • You are prompted to save your changes when you close the book. You can choose to save changes section by section or save all changes.

If you save the changes, Mathcad creates an annotated copy of your Electronic Book; it opens that copy rather than the original every time you open that E-book. The original state of the book is also saved so you can always restore it.


Browsing the Web from an E-book Window

You can use the E-book or Resources window to browse to any location on the Web. To do so:

  • Click on the Web Toolbar button on the E-book toolbar. You’ll see an additional toolbar with an “Address” line:

  • In the “Address” box, type a URL for a document on the Web.

The buttons to the left of the “Address” box let you bookmark a page for a later visit, reload the current page, and interrupt the current file transfer.


Creating an E-book

Mathcad is known for the ease with which "live" math equations, text, and graphics can be combined into a single document. For authors and publishers, Mathcad's E-books provide an exciting on-line publishing medium. In an E-book, formulas and numbers become "live" Mathcad regions. Graphs of equations become live Mathcad plots that the reader can resize, recalculate, and modify.

The QuickSheets and Tutorials in Mathcad are E-books that you can use as a guide for setting up your book. Examine other Mathcad Electronic Books you can download from the Mathcad Web Library to see the range of what others have done.

There are several steps to creating an E-book:

  1. Creating individual Mathcad files.

  2. Preparing a Table of Contents.

  3. Adding hyperlinks between appropriate files.

  4. Creating an HBK file to specify the order of the files in the book.

  5. Developing an index (optional).

  6. Checking the index, HBK file, and worksheets for errors.

Click the links above, which direct you to the Author's Reference. There you will find tips and techniques for creating Electronic Books out of your worksheets.

We recommend reading all steps of the process before you start creating an E-book.


Mathcad E-books

Mathsoft provides a growing library of E-books.

For more information contact Mathsoft at 1-800-MATHCAD, or email sales-info@mathsoft.com or int-info@mathsoft.co.uk. For the latest product information, visit the Mathsoft Webstore at http://webstore/www.mathsoft.com.

You can also download a number of Mathcad Electronic book from the Mathcad Web Library.

Other books are available for registered Mathcad users at the Mathcad.com download site.


Using the Collaboratory User Forums

The Collaboratory User Forums is an interactive World Wide Web service that puts you in contact with a community of Mathcad users. The Collaboratory consists of a group of forums that allow you to:

  • post messages and contribute Mathcad and other files,

  • download files and read messages contributed by other Mathcad users,

  • search the Collaboratory for messages containing a key word or phrase,

  • and take advantage of a number of other helpful features.

The Collaboratory combines some of the best features of a computer bulletin board or an on-line news group with the convenience of sharing worksheets and other files created using Mathcad. You can use the Collaboratory if you have Interne access.

To open the Collaboratory:

  1. Choose Collaboratory from the Help menu and click on the Collaboratory button to see the Collaboratory login screen.

  2. Log into the Collaboratory.

  3. Once you log in, you see the Collaboratory window.


Logging into the Collaboratory User Forums

You can log into the Collaboratory User Forums as a new user, an existing user, or a guest. To log in as a new user:

  1. Click the "New User" button.

  2. The New User Information form appears on your screen. Carefully follow the instructions to fill out the form. When you are done, click the "Create" button at the bottom of the form. MathSoft does nothing with this information except what is necessary to allow you to use the Collaboratory User Forums.

  3. In a short while, check your email for an email message giving you your login name and password.

  4. You have successfully created your new user profile. You can now go back to the Collaboratory login screen and log in as an existing user.

To log in as an existing user, simply enter your login name and password and click "Log In".

To log in as a guest, click "Guest". As a guest, you are limited to read-only access to the Collaboratory forums -- you can read all the messages, but cannot contribute your own.

Notes

  • Mathsoft does not use your user information for any purposes other than for your participation in the Collaboratory User Forums.

  • The Collaboratory allows you to edit your user profile at any time..


Reading Messages in the Collaboratory User Forums

When you enter the Collaboratory User Forums, you see how many messages are new and how many are addressed to your attention. You can view all messages or only those that are new since your last visit. Click the links on the text to see these messages or examine the list of messages in the right part of the screen. To read messages in any forum:

  1. Click on the "+" next to a forum, or on the forum name.

  2. Click on a message to read it, or on the "+" to the left of a message to view the replies underneath it.

  3. The message appears in the right side of the window.

Messages that you have not yet read are shown in italics. You may also see a "new" icon next to the new messages.


Posting Messages in the Collaboratory User Forums

In the Collaboratory User Forums, you can go to any forum and post a message or a reply to a message. To post a new message or a reply to an existing one:

  1. Decide which forum you want to post a message in. Click on the forum name to show the messages under it.

  2. To post a new message, choose Post from the menubar at the top of the Collaboratory window. To reply to a message:

    • Click on the message.

    • Click "Reply" at the top of the message, which should now be in the right half of the window.

  3. Enter the title of your message in the Topic field.

  4. Click on any of the boxes below the title to specify whether you want any of those options turned on.

  5. Type your text in the message field. You can include hyperlinks in your message by entering an entire URL such as http://www.myserver.com/main.html and other HTML code if you wish.

  6. Click "Post" at the bottom of the window when you finish typing. Depending on the options you selected, the Collaboratory either posts your message immediately or allows you to preview it.

  7. If you are attaching a file, a new page appears. Specify the file type and file on this page, and click "Upload Now".

To delete a message that you posted, click on it to open it and click "Delete" in the small menubar just above the message on the right side of the window.

For more information on posting or reading messages and other features of the Collaboratory User Forums, click Help on the Collaboratory menubar.


Searching the Collaboratory User Forums

To search the Collaboratory User Forums, click Search on the menubar at the top of the Collaboratory window. The Search Messages page shows up on the right-hand side of the Collaboratory window. You can use two types of message searches:

  • Key Word Search to find messages containing a specified key word or words,

  • and Date Range Search to find messages written between specified dates.

Both options are displayed in the window. To perform a Key Word Search:

  1. Enter the key word or words you are searching for.

  2. Select whether you want all the words to be matched by the search, or whether it is sufficient for any of the words to be in a message for the search to display it.

  3. Select the forums you want to be searched. You can select anywhere from one to all the forums.

  4. Select the date range of the messages you want to be searched.

  5. Select the category by which you want the displayed messages to be sorted.

  6. Select whether you want a detailed or a standard display of the results.

  7. Press the Search button to see the messages matching your search criteria.

A date range search is done in a similar manner. The only difference is that no key words are entered.

At the top of the Search Messages page are two options -- Today's Messages and Search Users. Click "Today's Messages" to display all the messages written today. Click "Search Users" to search for users who are in a particular city or country, or have a particular email address or homepage.


Editing Your User Profile in the Collaboratory User Forums

When you first log into the Collaboratory User Forums, you fill out a New User Information form with your name, address, and other information. This information is stored as your user profile. To change any of this information or make changes to the Collaboratory User Forum defaults, you need to edit your profile as follows:

  1. Click More on the menubar at the top of the window.

  2. Click Edit Your Profile.

  3. Make changes to the information in the profile.

  4. Click "Save" at the bottom of the page.

You can change information such as your login name and password. For privacy when posting messages, you can hide your email address or change your login name by editing your profile.


Additional Features in the Collaboratory User Forums

The Collaboratory User Forums has other features which make it easy to find and provide information to the user community. To perform activities such as creating an address book, marking messages as read, viewing certain messages, and requesting automatic email announcements when specific forums have new messages, or if you want to change your user information, choose More from the Collaboratory menubar.

The Collaboratory User Forums also supports participation via email or a news group. For more information on these and other features, click Help on the Collaboratory menubar.


Index of keystrokes

Directory of Keystrokes

This Help topic lists all the keystrokes by function. If you want to know what a particular keystroke does, you can search for it by clicking the Search tab.

By default, Mathcad uses Standard Windows keystrokes for many common operations. If you are upgrading from an earlier version, you may prefer to use classic Mathcad keystrokes instead. To do so, choose Preferences from the Tools menu, and click to remove the check next to "Use Standard Windows Shortcut Keys."

Greek letters

Operators

Worksheets and Windows

Editing

Arrow and movement keys

Creating regions


Greek Letters

To insert a Greek letter:

  1. Type the appropriate letter from the chart below.

  2. Type Ctrl+G

Alternatively, you may click on the appropriate letter on the Greek letter toolbar. The Greek letter p can also be typed by pressing Ctrl Shift p.


Keys for Creating Operators

The following keys are used to insert operators. They behave the same way in blank space as they do in an equation, with one exception, the " key.

Keystroke | Operator
! | Factorial
" | Complex conjugate
# | Range product
$ | Range sum
& | Integration
' | Matched pair of parentheses
( | Left parenthesis
) | Right parenthesis
* | Multiplication or inner (dot) product
+ | Addition
, | Separates arguments in a function Separates expressions to be plotted on the same axis; precedes 2nd number in range
; | Precedes last number in range
 | Negation or subtraction
/ | Division
[Ctrl] / | In-line division
[Ctrl] + | Mixed-number operator
< | Less than
> | Greater than
? | Differentiation
[Ctrl] ? | Nth derivative
[ | Array subscript
\ | Square root
[Ctrl \ | Nth root
^ | Exponentiation
| | Magnitude or determinant
[Ctrl] 1 | Transpose
[Ctrl] 3 | Not equal
[Ctrl] 4 | Sum of elements in vector
[Ctrl] 9 | Less than or equal
[Ctrl] 0 | Greater than or equal
[Ctrl] 8 | Cross product
[Ctrl] | Vectorize
[Ctrl] = | Equal to
[Ctrl] 6 | Superscript
[Ctrl] $ | Summation
[Ctrl] # | Product
[Ctrl][Enter] | Addition with linebreak
[Ctrl] I | Indefinite integral
[Ctrl] L | Limit
[Ctrl] A | Right-hand limit
[Ctrl] B | Left-hand limit
[Ctrl] & | Boolean AND
[Ctrl] ! | Boolean NOT
[Ctrl] ^ | Boolean OR
[Ctrl] % | Boolean XOR
[Ctrl] . | Symbolic evaluation
[Ctrl] > | Symbolic evaluation using keywords


Keys for Editing

Enter Insert blank line. In text, begin a new paragraph.

Delete Delete blank line. In text or math, remove character to the right of the insertion line.

Shift+Enter In text, begin a new line within a paragraph.

Ctrl+Enter Insert a page break. In text, set the width of the text region. In math, insert addition with linebreak operator.

Ctrl+A In text, select all the text in the text region.

Ctrl+A In a blank spot, select all regions in the worksheet.

Ctrl+Shift+Enter In a region, move the cursor out of and below a region.

Ctrl+F Find a character or string of characters.

Ctrl+H Replace a character or string of characters.

Ctrl+Z Undo last edit.

Ctrl+Y Redo. Reverses the action of Undo.

Ctrl+C Copy selection to clipboard.

Ctrl+V Paste clipboard contents into worksheet.

Ctrl+X Cuts selection to clipboard.

Ctrl+E Open the Insert Function dialog box.

Ctrl+U Open the Insert Unit dialog box.

Ctrl+Shift+J Allows you to type characters inside brackets as for chemistry notation.

Ctrl+Shift+K Allows you to type characters that usually insert operators.

Ins Enter insert mode.


Arrow and Movement Keys

Up arrow

Down arrow

Left arrow

Right arrow

Shift + Up arrow

Shift + Down arrow

Shift + Left arrow

Shift + Right arrow

Ctrl + Up arrow

Ctrl + Down arrow

Ctrl + Left arrow

Ctrl + Right arrow

Tab

Shift+Tab

Home

End

Ctrl + Home

Ctrl + End

Enter

Space

Ctrl + Enter In blank space, inserts a page break.

PgUp Moves up about 80% of the window height.

PgDn Moves down about 80% of the window height.

Shift+PgUp Moves up to the previous page break.

Shift+PgDn Moves down to the next page break.


Keys for Creating Regions

@ Create X-Y plot.

Ctrl+7 Create polar plot.

Ctrl+2 Create surface plot.

Ctrl+G Toggle previous character between Greek and roman.

Ctrl+M Create matrix or vector.

Ctrl+Shift+A (In text region) Insert math in text.

Ctrl+Shift+A (Not in text) Insert left limit operator.

Ctrl+Shift+B Insert right limit operator.

Ctrl+Shift+J Use chemistry notation. ie. Create a region within which any expression you type is treated as a single variable name.

Ctrl+Shift+P Insert Greek letter pi.

Ctrl+Shift+Z Insert infinity symbol.

Delete (In Region) Delete region.


Keys for Worksheet and Window Management

The following keys are used for manipulating windows and worksheets as a whole.

Ctrl+F4 Close worksheet

Ctrl+F6 Make next window active

Ctrl+K Insert or edit hyperlink

Shift+Enter Exit a text region

Ctrl+N Create new worksheet

Ctrl+O Open worksheet

Ctrl+P Print worksheet

Ctrl+S Save worksheet

Alt+F4 Quit

Ctrl+R Redraw screen

F1 Open Help window

F9 Recalculate a selected region

Ctrl + F9 Recalculate entire worksheet

Shift+F1 Enter or exit context sensitive Help

Esc Exit context sensitive Help or interrupt a calculation.


Technical Support

Mathsoft provides free technical support for individual users of Mathcad. Please visit the Support area of the Mathsoft web site at http://support.mathsoft.com.

If you reside outside the U.S. and Canada, please contact your local authorized Mathcad distributor for technical support. Their contact details can be found at: http://www.mathcad.com/buy/International_Contacts.asp.

If you do not have Web access you can contact MathSoft International directly for assistance at:

  • Email: help@mathsoft.co.uk

  • Fax: +44 (0)1276 475552 (Attn: Tech Support)

  • Telephone: +44 (0)1276 450850

Contact Mathsoft or your local distributor for information about technical support plans for site licenses.


Using the Help System

To access the Mathcad Help, choose Mathcad Help from the Help menu or press [F1]. Use the three tabs on the Help window to navigate to individual topics:

  • gives you access to a Table of Contents which is useful when you need an overview of topics available and a guide through them.

  • directs you to specific topics. Use the Index if you know the topic you are looking for.

  • searches the entire help system for a word or phrase. Full-text searching is useful when you are looking for a certain word or phrase, rather than a topic.

When you double-click on a topic title, the topic page displays in the right-hand side of the window.


Contacting Mathsoft

Contacting Mathsoft Engineering & Education, Inc.

US & Canada

Mailing address:

Mathsoft Engineering & Education, Inc.
101 Main St.
Cambridge, MA 02142
USA

Phone:1-800-Mathcad or 617-444-8000
Fax: 617-444-8001
Email: sales-info@mathsoft.com
Web site: http://www.mathsoft.com

All Other Countries

Mailing address:

Mathsoft Engineering & Education, Inc.
Knightway House
Park Street
Bagshot, Surrey
GU19 5AQ
United Kingdom

Phone: +44 1276 450850
Fax: +44 1276 475552
Email: int-info@mathsoft.co.uk
Web site: http://www.mathsoft.com

International Contacts Information Web Page

For the latest listing of international distributors for your country or region, go to this web page, www.mathcad.com/buy/international_contacts.asp.


Updating Your Mathcad Application

New versions of the Mathcad application periodically become available for download from the Mathcad Web site. To check if you have the most recent release of your version of Mathcad, choose Mathcad Update from the Help menu. Mathcad automatically determines if an update is available. If an update is available, your default browser will launch and you will be directed to the Download area of the Mathcad Web site.

Note:

  • In order to use this feature you must be connected to the Internet.

  • No information from your computer is sent to the Mathcad web site during the update process.


Other Sources of Information

Although Mathcad Help provides comprehensive information on Mathcad features, there are several other sources of information available to you:

Online Tutorials under the Help menu provide Getting Started Primers and In-depth Features.

QuickSheets under the Help menu provide working examples of most Mathcad features and programs that you can modify for your own work.

The Mathcad Collaboratory User Forums connects you to a community of Mathcad users.

E-books and Extension Packs

Mathcad E-books are hyperlinked collections of Mathcad worksheets in a variety of disciplines. Extension Packs extend Mathcad's functionality from Signal Processing to Solving and Optimization. You can download E-books from the download site and Web Library of Mathcad.com or visit the Mathsoft Webstore to purchase Mathcad libraries and Extension Packs.

Mathcad.com

Mathcad.com is filled with resources including hundreds of applied user files and E-books in the Web Library, Mathcad Advisor articles, downloads, and information about Mathcad-related applications.

Technical Support

Technical Support offers solutions to many questions via a searchable database in the Support area of the Mathcad Web site or by going directly to Mathsoft Technical Support.


3D Plot Format Dialog Box (QuickPlot Data Tab)

Range

Defines the range limits over which the function will be plotted with Range 1 and Range 2 corresponding to the first and second independent variables respectively (x and y in Cartesian coordinates).

Start

The lower limit to be evaluated and plotted for the independent variable. The default start value is -5.

End

The upper limit of be evaluated and plotted for the independent variable. The default end value is 5.

Note: The ranges set for the independent variables do not necessarily control the axis limits of the plot, unless you are plotting a single function of two variables in the Cartesian coordinate system. In all other cases, the axis limits are determined by the x, y, and z data generated by the worksheet for your function(s).

# of Grids

This is the number of grids, or points, generated for the given function and used to create the surface. The default is a 20 x 20 grid.

Coordinate System

Allows you to select the coordinate system on which the plot is created.

The Cartesian system takes values for x and y as independent variables and calculates z as the dependant variable.

The Spherical system takes a value for r and the angle phi as independent variables and calculates the angle theta as the dependant variable.

The Cylindrical system takes a value for r and the angle phi as independent variables and calculates the value of z as the dependant variable.


3D Plot Format Dialog Box (Advanced Tab)

Enable Fog

Shades the plot as if there were fog surrounding it. Makes distant parts of the plot appear dimmer to provide a depth cue. Plots are drawn more slowly with fog enabled.

Perspective

Makes a plot appear as if you were looking at it from a certain distance away in real life. Parts of the plot that are further away appear smaller than nearby parts of the same size. Specify the distance in the View Distance text box.

Viewing Distance

Specifies the distance when Perspective is checked.

Vertical Scale

Controls how tall the tall parts look. when VS is small, variations in the heights are barely perceptible. At 100, variations are such that the plot fills the entire frame.

Colormap - Increasing X, Increasing Y, Increasing Z

Applies the values in the selected colormap according to the x values, y values, or z values.

Choose Colormap

Specifies the colormap to use for fill, lines, and points if Colormap is checked for all three aspects on the Appearance page.

Shininess

Higher values make the plot appear shinier when lighting is enabled on the Lighting page and the surface of the plot is filled on the Appearance page. A shinier surface reflects more specular light.

% Transparency

Higher values make the plot more transparent so you can see through it.

Polygon Offset

Distinguishes lines and a filled surface when lines are drawn and the surface of a plot is filled. If set to zero, the lines may appear to go behind the surface and cause a "stitching" appearance.

High Quality Printing

Forces the 3D plot to print using your printer resolution. Otherwise, the plot prints at 150 dpi.

Set as default

Controls the printing default for all new 3D plots. Make sure "High Quality Printing" is set as desired, then check "Set as default." The printing information is recorded in the registry. (Note that this option never stays checked.)


3D Plot Format Dialog Box (Appearance Tab)

Fill Surface

Fills the plot surface with a colormap or with a solid color specified in the Color Options section.

Fill Contours

Fills the plot surface according to the x, y, or z contours. By default, fills according to the z values. To fill in a different contour direction, use the Contour Options on the Special page: Choose a contour direction from the drop-down menu then click Fill so it becomes checked.

Note: You can fill in up to 2 contour directions at once.

No Fill

The surface of the plot is not filled. It does not reflect light and has no color.

Alternate Mesh

Fills the surface of the plot using ½ filled rectangles.

Smooth Shading

Blends the colors in a filled plot from rectangle to rectangle so the coloring is smooth. Note that plots are drawn more slowly with "Smooth Shading" enabled.

Wireframe

Draws lines on the plot to form a frame on the plot.

Contour

Draws lines only in the direction of the x, y, or z contours. z contours are drawn by default. To draw lines in a different contour direction, use the Contour Options on the Special page.

No Lines

No lines are drawn on the plot.

Hide Lines

Hides lines that would not be visible if the plot was opaque.

Weight

Controls the thickness of the lines drawn on the plot.

Draw Points

Draws points at the data values making up the plot.

Symbol

Specifies the symbol to place at each point.

Size

Specifies the size of the symbol at each point.

Colormap

Colors the surface (fill) of the plot, the lines, or the points according to the values in the colormap specified on the Advanced page.

Solid Color

Colors the surface (fill) of the plot, the lines, or the points with the color specified in the box to the right.


3D Plot Format Dialog Box (Axes Tab)

To format the X, Y, or Z axis, click on the appropriate axis tab inside the dialog box.

Draw Lines

Draws grid lines at each grid on the selected axis.

Note: The grid lines are controlled by the options on the Backplanes page as well. When you set the grid lines for an axis on the Axes tab, you set them for the two backplanes shared by the axis. If you set the grid lines on the Backplanes tab, you set them for one backplane only.

Draw Ticks

Draws tick marks at each grid on the selected axis. The color of tick marks depends on the Axis Color.

Note: The tick marks are controlled by the options on the Backplanes page as well. When you set the tick marks for an axis on the Axes tab, you set them for the two backplanes shared by the axis. If you set the tick marks on the Backplanes tab, you set them for one backplane only.

Auto Grid

Chooses the number of grids automatically.

Line Color

Specifies the color of the grid lines.

Number

Specifies the number of grids to use when Auto Grid is not checked.

Line Weight

Specifies the thickness of the grid lines.

Label

When this box is checked, the text specified in the textbox appears on the axis.

Axis Color

Specifies the color of the axis and the tick marks.

Show Numbers

Displays numbers at each grid on the selected axis.

Axis Weight

Specifies the thickness of the axis.

Auto Scale

Chooses the axis limits automatically.

By default a plot axis is autoscaled.

When this box is checked, autoscale is ON and each axis limit is set to the first major tick mark beyond the end of the data.

When this box is not checked, autoscale is OFF and the axis limits are set right at the data limits.

To turn off autoscale and have your plot drawn to the ends of the plot region, click Plot Graph Format and then click on the autoscale check box for the appropriate axis to toggle it off.

Minimum Value

Specifies the lower axis limit when Auto Scale is not checked.

Maximum Value

Specifies the upper axis limit when Auto Scale is not checked.


3D Plot Format Dialog Box (Backplanes Tab)

To format the X-Y, Y-Z, or X-Z backplane, click on the appropriate tab inside the dialog box.

Fill Backplane, Color

Fills the backplane with a color specified in the box next to Color.

Backplane Border

Draws a border around the backplane.

Draw Lines

Draws grid lines or sub-grid lines on a particular axis.

NOTE: The grid lines are controlled by the options on the Axes page as well. When you set the grid lines for an axis on the Axes tab, you set them for the two backplanes shared by the axis. If you set the grid lines on the Backplanes tab, you set them for one backplane only.

Draw Ticks

Draws tick marks at the grids or sub-grids on a particular axis.

NOTE: The tick marks are controlled by the options on the Axes page as well. When you set the tick marks for an axis on the Axes tab, you set them for the two backplanes shared by the axis. If you set the tick marks on the Backplanes tab, you set them for one backplane only.

Line Color

Specifies the color of the grid lines or sub-grid lines.

Line Weight

Specifies the width of the grid lines or sub-grid lines.


3D Plot Format Dialog Box (General Tab)

Rotation

Specifies the amount of rotation (in degrees) about the z-axis. Must be an integer between -360 and 360.

Rotation = 0
You look directly down the first column of the matrix. The first row points right.

Rotation = 90
You look directly down the first row of matrix. The first column points left.

You can also rotate using the mouse.

Tilt

Specifies the amount of rotation (in degrees) about the x-axis that is formed after rotating the graph. Must be an integer between 0 and 180.

You can also tilt using the mouse.

Twist

Specifies the amount of rotation (in degrees) around the z-axis that is formed after rotating and tilting the graph. Must be an integer between -360 and 360.

You can also twist using the mouse.

Zoom

Specifies the amount to zoom in on the graph. The higher the zoom level, the closer you are to the plot. Must be between .01 and 100.

You can also zoom using the mouse.

Axes Style

Controls whether the axes appear at the front perimeter of the plot (perimeter), whether they intersect in the back left of the plot (corner), or whether they appear at all.

Equal Scales

Forces the same scale for all axes.

Show Border

Draws a rectangle around the entire graph. The box to the right specifies the color of the border.

Show Box

Draws a box around the plot. The box to the right specifies the color of the border.

Display As

Surface - Converts the plot into a surface plot that shows a three-dimensional illustration of a matrix's level curves.

Contour - Converts the plot into a contour plot that shows a three-dimensional illustration of a matrix's level curves projected onto a backplane. Defaults to the xy backplane. To project onto another backpalne, use the drop-down list in the Contour Options on the Special page.

Data Points - Converts the plot into unconnected points.

Bar Plot - Converts the plot into a 3D bar plot that shows a matrix as bars of varying heights.

Vector Field - Converts the plot into a vector field plot projected onto the xy backplane.

Patch Plot - Draws level, unconnected patches at each data point.


3D Plot Format Dialog Box (Lighting Tab)

To control general lighting, work with the options on the left of the dialog box. To format a directed light, click on the Light 1, Light 2, etc. tabs inside the dialog box.

Enable Lighting

Makes all the options on the Lighting tab operational.

Ambient Light Color

Specifies the color of the ambient light.

Lighting Scheme

Displays a list of built-in lighting schemes.

On/Off

Turns a directed light on or off.

Diffuse Color

Specifies the color of the diffuse light portion of a directed light.

Specular Color

Specifies the color (usually white) of the specular light portion of a directed light. Useful when controlling shininess on the Advanced page.

Light Location - X, Y, Z

Specifies the general location of a directed light on the X, Y, and Z axis .

Infinite Light Source

Makes a directed light located an infinite distance away.


3D Plot Format Dialog Box (Special Tab)

Fill

Fills the surface of the plot in the contour direction indicated in the drop-down menu at the bottom of the Contour Options section (Z-contours by default).

Draw Lines

Draws lines in the contour direction indicated in the drop-down menu at the bottom of the Contour Options section (Z-contours by default).

Auto Contour

Automatically determines the number of contour lines to draw in the contour direction indicated in the drop-down menu at the bottom of the Contour Options section (Z-contours by default).

Numbered

Shows numbers on the contour lines.

Number

Determines the number of contour lines to draw in the contour direction indicated in the drop-down menu at the bottom of the Contour Options section (Z-contours by default). Available only when Auto Contour is not checked.

Z-Contours, X-Contours, Y-Contours

Specifies a contour direction. After choosing a direction, specify the other options in the Contour Options section.

Bar Plot Layout

Matrix

Stacked

Side by Side

Spacing

Specifies the spacing between bars.

Interpolated Mesh (Rows, Columns)

This group is only active if you have created your surface plot by converting from a scatter plot. In such a case, you'll actually see an interpolated surface that approximates your scatter data.

To change the density of the mesh used for interpolation, edit the number of rows and columns in the Interpolated Mesh text boxes. If your data is not well approximated by a surface, it may be impossible to generate a useful interpolation. If this occurs, you'll see an appropriate message on the message line.

Connectivity

Controls how the line connects the points when Data Points on the General tab is checked and Lines on the Appearance tab are checked. Click one of the following options:

Row Order - In the order in which the points occur in the vectors

Increasing X - By increasing x values.

Increasing Y - By increasing y values.

Increasing Z - By increasing z values.

Line Style specifies the kind of line that connects the points (solid, dashed, dotted, or da-dot)


3D Plot Format Dialog Box (Title Tab)

Graph Title

Text to use as the title for the graph.

Above

Places the title above the graph.

Below

Places the title below the graph.

Hide

Hides the title on the graph.


3D Plot Wizard

To create a 3D plot, you can use the Graph commands from the Insert menu. Or, if you want more control over the format settings of a plot as it is inserted, use the 3D Plot Wizard.

To use the 3D Plot Wizard:

  1. Click in your worksheet wherever you want the graph to appear. Make sure you see the crosshair.

  2. Choose Graph \ 3D Plot Wizard from the Insert menu. The first page of the 3D Plot Wizard appears.

  3. Select the type of 3D plot you want to see and click “Next.”

  4. Make your selections for the appearance and coloring of the plot on subsequent pages of the Wizard. Click “Finish” to insert a plot with appropriate axes and a blank placeholder into your worksheet.

  5. Enter arguments into the placeholder.

  6. Click away from the plot.

  7. The plot is created using the settings you specified in the Wizard.


A “Find” or “Minerr” must be preceded by a matching “Given.”

This error marks a Find or Minerr function with no matching "Given". Each solve block that ends with Find or Minerr must begin with a region containing only the name "Given".


Accessing the Application Associated with a Component

If you have an application component in your worksheet, you can use the component to perform calculations in the application associated with it. To do so:

  1. Double-click on the component in the worksheet. The component opens and it either activates in-place or in a separate editing window.

  2. Edit the component however you would like.

  3. Click back in your worksheet to have the component recalculate and to resume working in your worksheet.

When you click outside the component, input variables are sent to the component and arrays are assigned to output variables in the worksheet. Once the output variables are created in the worksheet, you can manipulate them however you would like using built-in functions and operators for arrays.


Accuracy and Derivative Order

The accuracy tends to decrease by one significant digit for each increase in the order of the derivative.


Mathcad Activation

Mathsoft has implemented activation for purchasers of single-user versions of Mathcad, to ensure that you have purchased a valid licensed copy of the software.

Activating "locks" your Mathcad installation to your system by identifying key elements of your hardware configuration. As long as your hardware configuration does not change dramatically, you should not need to repeat the activation process. Un-installing and re-installing Mathcad does not require you to purchase an additional license. Should you need to reactivate your installation, Mathcad will launch an Activation Wizard to guide you through the process.

When you activate your Mathcad installation, no personal information is submitted to Mathsoft, except as necessary to process your activation request; for example, if you activate by email, you must provide an email address so that we can fulfill your request. The activation process is designed to be as anonymous as possible, and is only used to authenticate your installation.


Active Worksheet

This is the worksheet that will be sensitive to most menu commands, to toolbar buttons and to keystrokes. You can identify the active worksheet's window by its title bar. Look for the worksheet window having a distinctive title bar.


Mathcad Add-Ins

There are several applications for which specialized Mathcad Add-ins have been created. An Add-in allows you to insert a Mathcad object into another application, such as Visio, Excel, AutoCAD and VisSim. Visit the Download area of the Mathcad web site at http://www.mathcad.com/ for a complete list of available Mathcad Add-ins and information about how to download them for use.


Add Line Operator

Keystroke: ]

Creates a new line within a program, or creates a subprogram when inserted in the placeholder of an operator such as the if operator.


Adding or Removing a Region from a Selection

If you want to add or remove a region from a set of regions you've already selected:

  1. Move the pointer over the region.

  2. Press Ctrl and click the mouse.

Do not click the mouse without pressing Ctrl. Doing so will deselect the regions you've already selected.


Adding a Title to a Polar Plot

To add a title to a polar plot:

  1. Double-click on the plot or choose Graph / Polar Plot from the Format menu to open a tabbed dialog box.

  2. Click on the Labels tab.

  3. In the text box, type the title for your plot. You can use upper and lower case letters in the title.

  4. Click on either the "Above" or "Below" button.

  5. Click on “Show Title.” Then click "OK" to display the title of the plot region.

To hide the title, uncheck the "Show Title" check box to toggle it off. To delete the title altogether, backspace over it.


Adding a Title to an X-Y Plot

To add a title to a plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. Click on the Labels tab.

  3. In the text box, type the title for your plot. You can use upper and lower case letters in the title.

  4. Click on either the "Above" or "Below" button.

  5. Click on “Show Title.” Then click "OK" to display the title of the plot region.

To remove the title in the text box, click on "Cancel" to restore the title text box to its original state.

To hide the title, uncheck the "Show Title" check box to toggle it off. To delete the title altogether, backspace over it.


Adding or Removing Input and Output Variables

You may find that you want to add or remove input variables or output variables in an application component. To do so:

  1. Click once on the component to select it.

  2. To add another output, choose Add Output Variable from the pop-up menu. Another placeholder will appear to the left of the := .

  3. To add another input, choose Add Input Variable from the pop-up menu. Another placeholder will appear at the bottom of the component.

  4. To eliminate an output, choose Remove Output Variable from the pop-up menu. An output placeholder or variable to the left of the := will disappear. If there was more than one output, the last output placeholder or variable will disappear.

  5. To eliminate an input, choose Remove Input Variable from the pop-up menu. An input variable or placeholder at the bottom of the component will disappear. If there was more than one input, the placeholder furthest to the right will disappear.

When you add input or output variables to the Excel component, you’ll need to specify which cells in the component will store the new input and which will provide the new output. To do so:

  1. Click once on the component to select it.

  2. Choose Properties from the pop-up menu.

  3. Choose either the Inputs tab or the Outputs tab and specify a range of cells for each input and each output.


Addition operator

Keystroke: +

x + y

Returns the sum of x and y.

If you find an expression so long that it scrolls off the right of the screen, you may prefer to use Ctrl+Enter instead. This inserts

Operands:

x and y are scalars.

x and y must have the same dimensions.


Addition with linebreak operator

Addition with linebreak

Keystroke: Ctrl+Enter

Same as addition, except the two terms are on different lines.

Operands:

x and y are scalars.

x and y must have the same dimensions.

Use this to avoid expressions that scroll off the edge of the screen.

To break an expression using this operator:

  1. Click just to the right of the term that appears immediately before the plus sign at which you want to break the expression.

  2. Press Space until all the terms from the first to the selected one are held between the two editing lines.

  3. Press Del. The plus sign just after the editing lines disappear.

  4. Now type Ctrl+Enter to insert the plus with break.

  5. You can repeat this process if there are several terms connected by plus signs.


Advanced Options Dialog Box

The Advanced Options dialog box contains the following options:

Derivative estimation

Controls the method used to compute approximate first partial derivatives.

  • Choose "Forward" to look for results in one direction from the current point.

  • Choose "Central'' to look for results in two opposing directions from the current point. This can take more time, but may yield better results with fewer total iterations.

Variable estimation

Controls the method used to estimate initial values at the beginning of each search.

  • Choose "Tangent" to extrapolate from the line tangent to the reduced objective function.

  • Choose "Quadratic" to extrapolate to the minimum or maximum of a quadratic function fitted to the reduced objective function at its current point.

Linear variable check

Saves time by recognizing that if all the unknown variables occur linearly in all the constraints and assumes that first partial derivatives with respect to these variables are constant.

Use this only if you know that nonlinearly occurring variables will not appear to change linearly.

Multistart

Makes the nonlinear solver attempt to find a global maximum or minimum within the feasible region, rather than merely a local one.

Evolutionary

Finds good — though not necessarily optimal — solutions for problems where "classical" gradient methods are not sufficient. These methods assume that the problem functions (objective and constraints) are smooth functions of the variables (i.e. the gradients of these functions are everywhere continuous); the ability to converge to a local optimum depends on this assumption. In problems with non-smooth or even discontinuous functions, these methods often have difficulty reaching a solution. In such problems, the Evolutionary option — which makes no assumptions about the problem functions — can often help you find a good solution.

Even in smooth nonlinear problems, the "classical" gradient methods only find a locally optimal solution, and may miss a better solution far from the starting point you provide. The Evolutionary option gives you a much better chance of finding the globally optimal solution in such problems.

Notes:

  • These advanced options apply to the Conjugate Gradient or Quasi-Newton methods.

  • These options are for advanced users. You should use these only if a solution wasn't found using the default options or if you want tight control over the solving method.


Advanced View Settings for a 3D Plot

To control the appearance of a 3D plot with advanced options:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Advanced tab. The Advanced page shows options for formatting the view of a graph and for specifying details of a particular plot.

  3. Use the options on the page to:

    • Add fog to the graph

    • View the graph as if you were looking at it in the real world from a certain distance

    • Control how much a graph varies in height

    • Choose a colormap to use

    • Specify how a colormap is used

    • Control how shiny a plot looks

    • Control how transparent a plot is

    • Fine-tune the alignment of the plot surface with the plot lines

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Advantages of Automatic Mode

In automatic mode, the numerical results and graphs you see in your window are always up-to-date.


Advantages of Linking to a File

  • If several worksheets refer to the same picture, you only need one copy of that picture.

  • If you want to change a picture in several worksheets, you only have to change one picture file. You need not change every single worksheet.


Advantages of Manual Mode

In manual mode, you can scroll through worksheets faster because time-consuming calculations need not be performed as you scroll.


Algebraic Transformation

This is simply rearranging a math expression into another, equivalent math expression.


Aliasing

Because the fft is a discrete approximation to a continuous transform, you may encounter misplaced harmonics. This is called aliasing. To avoid aliasing:

  • Make sure the signal has finite bandwidth.

  • Make sure the sampling frequency is at least twice the bandwidth (the Nyquist frequency.)


Aligned Output Tables

Output table with "Center" alignment:

Output table with "Top" alignment:

Output table with "Bottom" alignment:

Output table with "Above" alignment:

Output table with "Below" alignment:


Aligning an Output Table

To control the way an output table is aligned with the variable or expression being displayed:

  1. Click on the output table to select it.

  2. Click on it again with the right mouse button.

  3. Choose Alignment from the pop-up menu.

  4. Choose Top, Center, Bottom, Below, or Above.


Alignment

You align a paragraph of text at either the left edge or right edge of the text region, or centered within the text region.

To control alignment using the Paragraph Format dialog box:

  1. Select text within the paragraph(s).

  2. Choose Paragraph from the Format menu.

  3. Make the appropriate changes in the Paragraph Format dialog box and click “OK.”

Alternatively, use the three alignment buttons [image] on far right of the Formatting toolbar.


All evaluations resulted in an error or complex result.

All evaluations resulted in either an error or a complex result.

You cannot plot any points because there are no real values to plot. This error may appear if there is an error or if all the values are imaginary.


Alphabetic Characters

Names are case and font sensitive. Names are also size and style sensitive. For example, a bold F and italic F refer to different variables.

Every character in a name must be in the same font. You can, however, mix Greek and roman letters in the same name.


Ambient Light

Ambient light is general light that shines evenly all around a graph.


And operator

And

Keystroke: Ctrl+Shift+7

x [image] y Returns 1 if both x and y are non-zero (true). Returns 0 otherwise.

Operands:

x and y are real or complex scalars.

Notes:

  • A value of 0 is FALSE, any non-zero value is TRUE.

  • and first evaluates x, if found to be TRUE (non-zero) y is then evaluated. Because of this the following give different results:

0 [image] (2/0) = 0 (2/0 is never evaluated)

(2/0) [image] 0 gives an error (2/0 causes singularity error)

Launch QuickSheet Example


Record Animation Dialog Box

The Record Animation dialog box has the following options:

From

Specifies the first value for the built-in FRAME variable. Each value of FRAME generates a separate frame in the animation sequence.

To

Specifies the last value for the built-in FRAME variable. Each value of FRAME generates a separate frame in the animation sequence.

At

Controls the default rate at which the animation is played back.

Since you can adjust the playback speed when you play back the animation, this value is important only when you want to add a soundtrack to your animation.

Animate

Click this button to begin recording the animation. This button is grayed out until you select a region in your worksheet to animate.

Save As

Click this button to save a recorded animation in a format suitable for use by most other multimedia applications.

This button is available only if there is something to save.

Options

Since animation clips tend to take considerable disk space, they are saved in compressed format. Click this to open a dialog box presenting numerous options relating to what compression method, if any, you want to use to save your animation.

FRAME (counter)

Shows the value of the built-in FRAME variable corresponding to the picture in the box above it.

Box showing the frames

Displays successive frames from your animation sequence as they are recorded. The frames may take a few moments to display the first time. However once they've been recorded, you'll be able to play them back much more quickly.

This box is empty until you select a region to animate and click the "Animate" button.


Frame View Box

This box shows the first frame of whatever animation clip is ready to be played back. If nothing is available for playback, this box disappears.

To make an animation available for playback, either open the file containing it or create an animation using the Animate dialog box.


Annotating a 3D Plot

To annotate a 3D plot by placing text on it:

  1. Insert text or import a graphics image into your worksheet.

  2. Select the text so that it is highlighted.

  3. Hold the mouse button down and drag the cursor onto the plot where you want the annotation to be located.

  4. Let go of the mouse button.

To annotate a 3D plot by placing a bitmap on it:

  1. Copy the bitmap from another application to the Clipboard.

  2. Click on the plot with the right mouse button.

  3. Choose Paste Special from the pop-up menu.

To edit an annotation:

  1. Select it.

  2. Drag it off the plot

  3. Edit it.

  4. Drag it back onto the plot.

To add a title to a plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. Click on the Title tab to bring up the Title page.

  3. Enter text for the title in the Title text box.

  4. Click Above or Below.

  5. Click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Antisymmetric Tensor Function

(i,j,k) This function returns the completely antisymmetric tensor of rank 3. Result is 0 if any two arguments are the same, 1 for even permutations, -1 for odd permutations.

Arguments:

i, j, and k must be integers between 0 and 2 (or ORIGIN and ORIGIN+2)

Note:

The antisymmetric tensor of rank 3 determines how many times you have to swap two numbers in order to get back to the sequence [0,1,2] from whatever sequence [i,j,k] you passed to it. If the number of times is even, the function returns 1. If the number of times is odd, the function returns -1.

For example, (2,0,1)=1 because to get from [2,0,1] to [0,1,2] you’ll have to swap twice (an even number). On the other hand, (0,2,1)=-1 because to get from [0,2,1] to [0,1,2] you only have to swap once (an odd number).


Appending Data to an Existing File (APPEND function)

Appending Data to an Existing File

APPEND(“file”) Appends a single number to file.

Arguments:

file is either the pathname to an ASCII data file.

file is entered as a string.

APPEND is usually used in conjunction with a vector subscripted with a range variable as in:

i := 1 to N

APPEND(“file.dat”) :=

The above example appends the list of numbers in the vector v to those already in file.dat.

Note that the file must already exist for APPEND to work. You cannot use APPEND to create a file. It can only append to an existing file.

WARNING: This function is provided only for compatibility with older versions of Mathcad. It is, however, obsolete and its use is not recommended. Instead, you should use the APPENDPRN function to append data to a file.


Appending Data to an Existing File (APPENDPRN function)

Appending Data to an Existing File

APPENDPRN(“file”) Appends an array to file.

Arguments:

file is either the filename or the full pathname to a structured ASCII data file.

file is entered as a string.

The number of columns in file must match the number of columns in the array.

If the file does not already exist, APPENDPRN will create it.

Example:

APPENDPRN("c:\data\results.prn") := A

A is a matrix whose values are added to the ones already existing in the file results.prn located in the c:\data directory.

Notes:

  • APPENDPRN arranges the ASCII file in rows and columns like the original matrix. By default, APPENDPRN will append four significant digits in columns eight digits wide. To change this, choose Worksheet Options from the Tools menu and click on the Built-In Variables tab in the dialog box. Change PRNPRECISION and PRNCOLWIDTH.

  • Whenever you change the argument to this function, click on it and choose Calculate from the Tools menu to update it.


Applying a Different Math Style

To change the math style associated with a particular name or number:

  1. Click in the name or number.

  2. Choose Equation from the Format menu.

  3. In the Equation Format dialog box, choose a style from the drop-down list. You'll see several predefined math styles. You can create a new style using the User math styles.

  4. If necessary, alter the font characteristics associated with these styles by clicking on "Modify".

  5. Click "OK" to assign the selected style to the selected name.

Note that variable names are font sensitive. For example, if you have a statement like "x := 1" in your worksheet and you change its style so that it looks like "x := 1", any x's further down in the worksheet will be undefined. You'll need to apply the same style to them so to look like "x".


Approximate Solutions

Minerr(var1, var2, ...) This returns the values of var1, var2... that come closest to satisfying the equations and inequalities in a solve block.

Arguments:

var1, var2,... are scalar variables found in the system of equations.

Using the function:

To use the minerr function to find the approximate solution to a system of equations:

  • Define guess values for the unknown variables.

  • Type the word Given to start the solve block.

  • Beneath the Given, type equalities and inequalities using boolean operators.

  • Use the minerr function.

Notes:

  • The difference between minerr and find is that if the solver cannot make any further improvements to the solution, minerr returns a value anyway. The find function on the other hand, will return an error message indicating that it could not find a solution.

  • When the solve block involves only one unknown, minerr returns a scalar. Otherwise, it returns a vector whose first element is var1, second element is var2 and so on.

  • The algorithm for the minerr function involves a special solving process where an appropriate method is chosen from a group of available methods.

  • For systems having more than one solution, the solution returned depends on the guess values. Adding inequalities may also force the solver to find a different solution.

  • If you purchase and install the Solving and Optimization Extension Pack (Expert Solver), the minerr function supports mixed integer programming which allows you to force solutions to be integers or binary numbers.

Example:

Approximate solution to a system of nonlinear equations

Launch QuickSheet Example


Argument List

This is the list of variables between the parentheses in a function. For example, in the expression:

f(x, y, z) := x + y + z + w

The argument list is

x, y, z


Argument to a Function

This refers to whatever appears between the parentheses when you use or define a function. For example:


Argument too Large

  • Argument too large

  • Integer too large in context

  • Object too large

Usually the result of evaluating an expression with a floating point value larger than about 10 to the 10 billion.


Arguments in function definitions must be names.

The indicated function definition contains an invalid list of arguments. A valid function definition begins like this:

function name (argument list) := ...

The argument list must be a name or a list of names separated by commas. Any other expression is illegal.

You also see this error message if you create an invalid list in another context, for example, in the list of y-axis expressions for a plot.


Array addition operator

Array Addition

Keystroke: +

A + B

Adds the elements of A to the corresponding elements of B.

A + x

Adds x to every element in A.

Operands:

  • A and B are arrays with the same number of rows and columns.

  • The elements of A and B must have the same dimensions.

  • x is any scalar, real or complex.

  • x must have the same dimensions as the elements of A.

Launch QuickSheet Example


Array Origin

This represents the starting index of all arrays; the default value for ORIGIN is 0. To change it, choose Worksheet Options from the Tools menu and go to the Built-in Variables tab.

You can set ORIGIN to any integer, positive or negative. The value you set for ORIGIN will affect every array in your worksheet.


Array Results Displayed in an Output Table

One way to display array results is in an output table:

Output tables have the following features:

  • A scroll bar appears along the appropriate edge of an output table if your results extend beyond the table.

  • You can resize an output table to see all the values.

  • You can copy values from an output table and paste them into a blank spot of your worksheet, into a placeholder, or into another application.

  • You can export values being displayed in an output table to an external data file.

  • Click on an output table and choose Result from the Format menu to control other aspects of an output table, such as the way the values are displayed.

  • If you double-click on a cell showing nested array notation, the nested array displays temporarily in an output table.

  • You can control the alignment an output table with respect to the variable name on the left.

  • To control the font of the values displayed in the table, click on it with the right mouse button, choose Properties from the pop-up menu, and click the Font button.

  • To hide row and column labels, click on the table with the right mouse button, choose Properties from the pop-up menu, and click "Show column/row labels."

  • See: Output Table Properties: Display Dialog Box

Launch QuickSheet Example


Array Results Displayed in Matrix Form

One way to display vector or matrix results is in matrix form:

When you display a large vector or matrix as an array rather than in an output table, only the first 200 rows or columns are displayed. Ellipsis are used to indicate that rows and columns are stored internally but not displayed.

Launch QuickSheet Example


Array Subscript Operator

Keystroke: [

This returns the nth element of v. If v has no nth element, you'll see an appropriate error message.

This returns the mnth element of M. If M has no mnth element, you'll see an appropriate error message.

Operands:

v is a column vector.

M is an array.

m and n must be dimensionless integers.

Keep in mind that all array rows and columns start at 0 by default. To change this, choose Worksheet Options from the Tools menu, then go to the Built-in Variables tab and change ORIGIN.

Note:

Use subscripts when graphing vectors.


Array subtraction operator

Array subtraction

Keystroke: -

A - B

Subtracts the elements of B from the corresponding elements of A. A and B must have the same number of rows and columns.

A - x

If A is an array and x is a scalar then A - x is an array formed by subtracting x from every element in A.

Operands:

A and B are matrices having the same number of rows and columns.

x is a scalar.


Arrow Pointer

When you see the arrow pointer, a mouse click will:

  • place a crosshair wherever you click if you click in a blank space, or

  • place a text insertion point if you click in text, or

  • place a pair of editing lines if you click in math.


ASCII File

This is a simple text file you can open in a basic text editor such as Notepad for Windows or SimpleText for Macintosh. The file contains nothing but letters, numbers, spaces, tabs and carriage returns. Many applications can save their documents in this form. You would usually use the Save As command and look in the scrolling list of file types.


Aspect Ratio

Ratio of length to width.


At least one limit must be infinity.

When the integration routine being used is "Infinite Limit," at least one of the limits on the integral must be infinity or negative infinity. Type infinity by pressing Ctrl+Shift+Z.

To change the integration routine to something other than "Infinite Limit," click on the integral with the mouse button and choose another routine from the pop-up menu.


Automatic Calculation Mode

Your worksheet is in automatic mode by default. This means that your worksheet updates results automatically.

Advantages of automatic mode...

Disadvantages of automatic mode...

How to tell when you're in automatic mode...

How to get into automatic mode...


Available Only in CGS

Available only in CGS.

Not available in SI, MKS, or US.


Available Only in MKS, SI, and US

Available only in MKS, SI, and US.

Not available in CGS.


Available Only in MKS and US

Available only in MKS and US.

Not available in CGS or SI.


Available Only in SI

Available only in SI.

Not available in MKS, CGS, or US.


Available Text Styles

Available text styles depend on the worksheet template that was used to create the worksheet. The dialog box below shows the styles that accompany the NORMAL.MCT template on which many worksheets are based.


Avoiding Undefined Expressions

Before you use any variable or function, make sure you've defined it earlier in your worksheet.


Axes Page for Polar Plots

The Formatting Currently Selected Polar Plot dialog box has the following options on the Polar Axes tab:

Log Scale

Makes the radial axis logarithmic. The axis limits must be positive.

Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by gridlines.

Numbered

When this box is checked, the tick marks on the selected axis are numbered.

Show Markers

Lets you add radial reference lines to a plot. To do so:

  1. Click on the "Show Markers" checkbox in the Radial Axis column. You'll see two additional placeholders on the upper-left side of the plot.

  2. Click on one of the placeholders and type in the value at which you want a line drawn. Repeat this process on the other placeholder to add the second radial reference line.

Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

Number of Grids

When Auto Grid is not checked, enter an integer from 2 to 99 to indicate the number of grid lines to draw. Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.

Grid Color

Controls the color of the grid lines. This option becomes available when “Grid Lines” is checked for the x-axis, the y-axis, or both. Click the Grid Color... button, select a color in the Color dialog, and click OK.

Axis Style - Perimeter, Crossed, None

Controls whether the axes intersect in the center of the plot (crossed), whether they enclose the plot in a circle (perimeter), or whether they appear at all.


Axes Page for XY Plots

The following XY plot formatting options are available on the X-Y Axes tab:

Log Scale

When this box is checked, the selected axis is logarithmic. The axis limits must be positive.

Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by gridlines.

Numbered

When this box is checked, the tick marks on the selected axis are numbered.

Autoscale

Sets the appropriate axis limit to the first major tick mark beyond the end of the data. When autoscale is disabled, the appropriate axis limits are set right at the data limits. By default, X-Y plots are autoscaled on both axes.

To turn off autoscale and have your plot drawn to the ends of the plot region, right-click on the plot and choose Format from the pop-up menu. Click on the "Autoscale" check box for the appropriate axis to toggle it off.

Show Markers

Lets you add one or two horizontal or vertical lines to a plot. When this is checked, you'll see two additional placeholders on the axis. To add a vertical line, click on one of the placeholders under the x-axis and type in a value at which you want a line drawn. For a horizontal line, do the same thing in one of the placeholders to the left of the y-axis. Then choose Calculate from the Tools menu to redisplay the plot.

Auto Grid

When this box is checked, the number of tick marks is chosen automatically. When this box is not checked, you need to specify the number of tick marks in the Number of Grids box.

Number of Grids

Controls the number of tick marks when Auto Grid is not checked. Enter an integer from 2 to 99. Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.

Grid Color

Controls the color of the grid lines. This option becomes available when "Grid Lines" is checked for the x-axis, the y-axis, or both. Click the "Grid Color" button, select a color in the Color dialog, and click "OK".

Axes Style - Boxed, Crossed, None

Controls whether the axes intersect in the center of the plot (crossed), whether they intersect in the bottom left of the plot (boxed), or whether they appear at all.

Equal Scales

When this is checked, the x and y-axes have equal scales. This means that if one inch along the x-axis stands for 2 units, then one inch along the y-axis will likewise stand for 2 units.

When this is not checked, the scale on the x-axis is independent of the scale on the y-axis.


Axis Settings for a 3D Plot

To select the characteristics of the axis for a 3D plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. Click on the Axes tab. The Axes page shows three tabs for formatting each of the three axes.

  3. Click on one of the axes tabs to format a particular axis. Use the options on the page to:

    • Draw grid lines or tick marks

    • Control the color and weight of the grid lines

    • Show numbers on the grids

    • Set your own axis limits by turning Auto Scale off and specifying Minimum and Maximum values.

    • Control the color and weight of the axis

    • Add labels to your axes

    • Set your own grid by turning Auto Grid off and specifying the number of grids.

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.

Axis style

To control how the axes are arranged:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the General tab to open the General page. Use the Axes Style options to specify Perimeter, Corner, or Equal Scales. Click None to hide the axes.

  3. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Axis Settings (Polar Plots)

Axis Settings on Polar Plots

To select the characteristics of each axis:

  1. Double-click on a plot or choose Graph Þ Polar Plot from the Format menu to open a tabbed dialog box.

  2. Click on the Polar Axes tab.

  3. Make appropriate changes.

  4. Click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Axis Settings (X-Y Plots)

To select the characteristics of each axis:

  1. Double-click on a plot or choose Graph Þ XY Plot from the Format menu to open a tabbed dialog box.

  2. Click on the X-Y Axes tab.

  3. Make the appropriate changes.

  4. Click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Axum

Axum is a technical graphing and data analysis application available from Mathsoft. Axum gives you access to over 50 2D and 3D graph types. You can use the Axum component to insert an Axum plot driven by Mathcad variables in your worksheet.


Axum component properties: Graph

Axum Component Properties: Graph Properties

Use the options in the Graph Type page to specify the kind of graph to view using the Axum component.

Axis Type

Shows the current Axum axis type.

Plot Type

Shows the current Axum plot type.

Choose Axis/Plot Type

Brings up the Choose Graph and Plot Type dialog, which has scrolled lists from which you can select the axis type and the plot type, for example Log Y Line with Scatter.

Number of Inputs

Allows you to change the number of inputs to the graph component. The Axum Graph component is limited to four inputs.

Use Last Input for Conditioning Variables

Allows you to specify the last variable in the input list to be a conditioning variable.


Backplane Settings for a 3D Plot

To control the appearance of backplanes on a 3D plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Backplanes tab. The Backplanes page shows three tabs for formatting each of the three backplanes.

  3. Click on one of the tabs to format a particular backplane. Use the options on the page to:

    • Draw grid lines or sub-grid lines

    • Draw or tick marks or sub-tick marks

    • Control the color and weight of the grid lines and sub-grid lines

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Backspacing a Binary Operator


Bar Layout Settings (For a 3D Bar Plot)

To control the layout of the bars in a 3D bar plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. Click on the Special tab.

  3. The Special page has the following options in the Bar Plot Layout section:

Matrix

Stacked

Side by side

Spacing

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Be Careful of Infinite Loops

Be sure the value of the test expression does in fact change somewhere in the iteration. Otherwise, you find yourself in an infinite loop. If this does occur, press Esc to interrupt calculation.


Beginning Arrays at an Element other than Zero

By default, arrays begin at element one. To change this, change the value of the built-in variable ORIGIN by doing either of the following:

  • Choose Worksheet Options from the Tools menu and go to the Built-in Variables tab.

OR

  • Enter a global definition for ORIGIN anywhere in your worksheet (be sure to use capital letters).

When you change the ORIGIN to something other than its default, certain elements may not longer exist. For example, if you change the ORIGIN to two, the worksheet no longer maintains an element one for vectors or a row one and column one for matrices. You will see an error if you try to access an element that no longer exists.


Bessel Functions

Mathcad supports a complete set of Bessel functions for complex arguments, and fractional and negative orders. These are summarized below. All Bessel functions, except Airy and Spherical Bessel functions, have scaled versions formed by typing .sc after the function name. The scale for the scaled version is indicated below the table entry.

Arguments:

In each case, unless noted,

z is a dimensionless complex scalar.

m is a real number.

Bessel functions of the first and second kinds

J0(z) Returns J0(z), the zeroth order Bessel function of the first kind.

J1(z) Returns J1(z), the first-order Bessel function of the first kind.

Jn(m, z) Returns Jm(z), the mth-order Bessel function of the second kind.

Y0(z) Returns Y0(z), the zeroth order Bessel function of the second kind.

Y1(z) Returns Y1(z), the first-order Bessel function of the second kind.

Yn(m, z) Returns Ym(z), the mth-order Bessel function of the second kind.

Scaled versions have a scale factor of exp(-|Im(z)|).

Modified (Hyperbolic) Bessel functions

I0(z) Returns I0(z), the zeroth order modified Bessel function of the first kind.

I1(z) Returns I1(z), the first-order modified Bessel function of the first kind.

In(m, z) Returns Im(z), the mth-order modified Bessel function of the second kind.

K0(z) Returns K0(z), the zeroth order modified Bessel function of the second kind.

K1(z) Returns K1(z), the first-order modified Bessel function of the second kind.

Kn(m, z) Returns Km(z), the mth-order modified Bessel function of the second kind.

Scaled modified Bessels of the first kind (I) have a scale factor of exp(-|Re(z)|). Scaled modified Bessels of the second kind (K) have a scale factor of exp(z).

Hankel functions

H1(m, z) Returns the Hankel function of the first kind (Bessel function of the third kind).

H2(m, z) Returns the Hankel function of the second kind (Bessel function of the third kind).

Scaled versions have a scale factor of exp(-|Im(z)|).

Airy functions

Ai(z) Returns the Airy function of the first kind

Bi(z) Returns the Airy function of the second kind.

In this case, no scaled versions are available.

Bessel Kelvin functions

bei(m,x) Returns the value of the imaginary Bessel Kelvin function of order m.

ber(m,x) Returns the value of the real Bessel Kelvin function of order m.

In this case, the argument x must be real, and m must be a non-negative integer.

Spherical Bessel functions

js(m,z) Returns the value of the spherical Bessel function of the first kind, of order m.

ys(m,z) Returns the value of the spherical Bessel function of the second kind, of order m.

In this case, no scaled versions are available.

Notes:

Very large positive or negative values of z or m may cause overflow or underflow errors. If your calculations require these values, you may be able to use the scaled version of the function instead.


Beta Distribution

Distribution generators for the Beta Equation:

dbeta(x,s1,s2) Returns the probability density.

pbeta(x,s1,s2) Returns the cumulative probability distribution.

qbeta(x,s1,s2) Returns the inverse cumulative probability distribution.

rbeta(m,s1,s2) Returns a vector of m random numbers having the beta distribution.


Binary Operator

An operator with two operands. For example, "+" is a binary operator because you would always see "x + y". Here, x and y are the two operands.


Binomial Distribution

Distribution generators for the Binomial Equation:

dbinom(k,n,p) Returns the probability density.

pbinom(k,n,p) Returns the cumulative probability distribution.

qbinom(p,n,r) Returns the inverse cumulative probability distribution.

rbinom(m,n,p) Returns a vector of m random numbers having the binomial distribution.


Restoring a Bitmap to its Original Size

If you've resized a bitmap, you can restore it to its original size and aspect ratio as follows:

  1. Click on the image with the mouse button.

  2. Choose Properties from the Format menu and click on the Display tab.

  3. Click on the box labeled "Display at original size".

  4. Click "OK."


Bitmap Graphics

A graphic image stored in standard Windows graphics format.

Many Windows applications, for example the Paintbrush accessory that ships with Windows, can create bitmap images.

Bitmap images stored in files usually end in the extension 'BMP'


Editing an Object

To edit a graphics image after inserting or pasting it into your worksheet:

  1. Double-click on the graphic.

  2. If the graphic is from an application which supports in-place activation, a hatched border surrounds the graphics object and the menus and toolbars change to the source application’s menus and toolbars. If the graphic is from an application that does not support in-place activation or if the graphic is a linked object, a separate window for editing appears.

  3. Make any necessary edits.

Note:

If you insert a bitmap using the Picture command or if you paste an image as a bitmap, you cannot edit it using the steps outlined above.


Importing an Object by Dragging and Dropping

To import a linked object directly from another application:

  1. Open the source application.

  2. Arrange your worksheet window and the source application window side-by-side on the screen.

  3. Select the graphic in the source application.

  4. Hold the mouse button down and drag the cursor to the worksheet.

  5. Let go of the mouse button to drop the graphic into the worksheet.


Importing a Graphics Image from the Clipboard

To import a graphics image from another application via the clipboard:

  1. Copy the image to the clipboard.

  2. Click the mouse wherever you want to place the image.

  3. Choose Paste or Paste Special from the Edit menu to paste the image into the worksheet.

Note:

When you choose Paste, the image on the clipboard is pasted according to the default information stored with it on the clipboard. If you want to paste the image as a particular kind of object (bitmap, linked object, or embedded object), choose Paste Special.


Resizing a Graphics Region

To change the length and width of a graphics region:

  1. Click on the graphics region. This encloses it in a selection rectangle. You will see three handles.

  2. Move the pointer to one of the handles at the bottom or right border of the region. It should change to a double-headed arrow.

  3. With the mouse button pressed, move the mouse. The graphics region will be stretched in the direction of motion.

  4. Once the graphics region is the right size, let go of the mouse button.


Book Menu

Annotate Book

Highlight Changes

Save Section

Save All Changes

View Original Section

View Edited Section

Restore Section

Restore All


Boolean Expression

This is an expression whose result is either true or false. For example:

"1 > 2" is Boolean because its value is "FALSE".

"x = 2" is Boolean because it could be either "TRUE" or "FALSE", depending on the value of "x".

"1 + 1" is NOT Boolean because it is neither "TRUE" nor "FALSE", it is simply "2".


Boolean Toolbar

The Boolean toolbar buttons give you quick access to boolean and logical operators. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Bottom margin

This is the distance from the bottom edge of the physical sheet of paper to the bottom edge of the print area. If your worksheet has a footer, it appears just below this margin.


Box Pointer

When the pointer looks like this, you can copy whatever math expression you selected to a new location. To get this pointer,

  • Click on any part of an expression.

  • Press and hold down the Ctrl key and the mouse button.

Drag the pointer either to an empty space or to a placeholder and release the mouse button to drop the expression you selected.


Bringing data from Excel into Mathcad

Bringing Data from Excel into a Worksheet

You can bring data from Excel into a worksheet so you can perform calculations on the data.

How do you want to bring the data in?

  • Just once using copy and paste

  • Just once from a data file

  • I want a live link to the Excel file so that if the data changes in the Excel worksheet, it changes in my worksheet too.

  • I want a live link to the Excel file with more control over which data I exchange and the ability to use Excel's functionality.

Just once using copy and paste

This method is useful when you have a small amount of data to bring over to your worksheet. To copy data from Excel and paste it into your worksheet, follow the instructions for pasting data from the clipboard.

Just once from a data file

If you have an Excel worksheet containing data, you can import the data into your worksheet and store it as an array. To do so, follow the instructions for importing data from a data file.

I want a live link to the Excel file so that if the data changes in the Excel worksheet, it changes in Mathcad too.

If you have an Excel worksheet containing data, you can read the data into your worksheet with a File Input component. This component brings data into Mathcad and stores it as an array. It also establishes a live connection between your worksheet and the Excel worksheet. If the data in the Excel worksheet changes, the data in the worksheet array also changes. To bring in data from Excel this way, follow the instructions for reading data from a data file.

I want a live link to the Excel file with more control over which data I exchange and the ability to use Excel's functionality.

The Excel component allows you to use Excel's functionality in your Mathcad worksheet and provides more options for specifying which data you want to exchange with Excel.


B-spline Interpolation

bspline(vx,vy,u,n) Returns a vector containing the coefficients of a B-spline of degree n for the data in vx and vy, given the knots indicated by the values in u. The vector returned becomes the first argument of the interp function.

interp(vs,vx,vy,x) Returns a B-spline interpolated value of vy at a point x where vs is the result from the bspline function.

Arguments:

vx is a vector of real data values in ascending order. These correspond to the x values.

vy is a vector of real data values. These correspond to the y values. Contains the same number of elements as vx does.

u is a real vector with n-1 fewer elements than vx (where n is 1, 2, or 3). Elements of u must be in ascending order. The elements contain the values of the knots for interpolation. The first element in u must be less than or equal to the first element in vx. The last element in u must be greater than or equal to the last element in vx.

n is an integer equal to 1, 2, or 3, indicating the degree of the individual piecewise linear (n=1), quadratic (n=2), or cubic (n=3) polynomial fits.

vs is a vector generated by bspline.

x is the value of the independent variable at which you want to interpolate a result. For best results, this should be in the range encompassed by the values of vx.

B-spline interpolation lets you pass a curve through a set of points. This curve is assembled by taking three adjacent points and constructing a polynomial of degree n passing through those points. These polynomials are then strung together at the knots to form the completed curve.


Vector returned by Bspline

The elements in the vector returned by bspline are as follows:

  • The first element is 4, indicating the vector is the result of the bspline function.

  • The second element is the coefficient matrix for the B-spline fit.

  • The third element is the interval matrix corresponding to the fit.

The vector returned by bspline should always be passed to interp.


String Functions

The following functions are useful when working with strings:

concat(S1,S2)

Concatenates string S2 to the end of S1. Returns a string.

error(S)

Returns the string S as an error message.

IsScalar(x)

Returns 1 if x is a real or complex number, otherwise returns 0.

IsString(x)

Returns 1 if x is a string, otherwise returns 0.

strlen(S)

Determines the number of characters in the string S. Returns an integer.

substr(S,n,m)

Extracts a substring of S starting with the character in positionn and having at most m characters. The arguments m and n must be integers.

search(S,SubS,x)

Finds the starting position of the substring SubS in S, beginning from position x in S.

str2num(S)

Converts a string of numbers S into a constant.

num2str(x)

Converts the number x into a string.

str2vec(S)

Converts a string S to a vector of ASCII codes.

vec2str(v)

Converts a vector of ASCII codes to a string.


Bullets

You can apply round, black bullets to paragraphs within a text region. For example, the three paragraphs below have bullets:

  • Line 1

  • Line 2

  • Line 3


Calculator Toolbar

The Calculator toolbar buttons gives you quick access to basic math operators and functions. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title and

  • A description of the button appears on the message line of the Status Bar.


Calculus Toolbar

The Calculus toolbar buttons give you quick access to calculus operators. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Can’t find a solution to this system of equations.

Can’t find a solution to this system of equations. Try a different guess value or check that a solution really exists.

Sometimes the solver fails to converge on a solution. This happens when the difference between successive approximations to the solution is greater than TOL and:

  • The solver reaches a point where it cannot reduce the error any further.

  • The solver reaches a point from which there is no preferred direction. Because of this, the solver has no basis on which to make further iterations.

  • The solver reaches the limit of its accuracy. This often happens if you set TOL to a value below 10^-15.

Make sure there really is a solution. Then try:

  • Raising the value of TOL

  • Using the minerr function instead of the find function

  • A different guess value

  • Adding an inequality to avoid an undesirable stopping point.

  • Changing the solving parameters or the solving method.


Can’t plot this many points.

You tried to plot more points than could be handled in one plot. Try keeping the number of points below 150,000.


Can’t raise an expression having units to a complex power.

This expression contains units, and you are raising it to a complex power. You can only raise an expression with units to a real power.

If you want to raise an expression with units to a complex power, you can first divide the expression by the UnitsOf(expression) so the units are cancelled out.


Can only evaluate an nth order derivative when n=0,1..5

Order is not one of the following numbers: 0,1,2...5. If you want to evaluate a higher order, do so symbolically.


Can only plot positive values when log axes are used.

This xy plot or polar plot has a logarithmic axis in which either the limits, or some of the values are not positive.

Negative numbers and zero cannot be placed anywhere on a logarithmic axis.


Can't converge to a solution. Encountered too many integrator steps.

The algorithm for this differential equation solver did not find a solution. Try changing your guess values for the unknown initial conditions. However, there may be no solution for the boundary values you've provided.


Can't converge to a solution. The integrand may have...

Can’t converge to a solution. The integrand may have a singularity or the integral may not be finite.

Results involving integrals, derivatives, the root, find, or minerr functions require iteration. If after many iterations successive estimates still differ by more than the required tolerance, you'll see this error message.

Try setting TOL to be larger. If you're working with the root, find, or minerr functions try a different guess value as well.


Can't define the same variable more than once...

Can’t define the same variable more than once in the same expression.

You tried to evaluate the same variable twice in the same definition. For example, if you create a vector on the left side of a := and use the same name in more than one element, you will get this error.


Can't determine what units the result...

Can’t determine what units the result of this operation should have.

You have raised an expression involving units to a power involving a range variable or a vector. As a result, there is no way to determine the dimensions of the result. If an expression is defined with units, you can raise it only to a fixed real power.


Can't evaluate this expression because its either too complicated...

Can't evaluate this expression because it's either too complicated or it's defined in terms of itself.

This error message most commonly arises when you try to define a function in terms of itself. This results in a recursive function definition with no terminating condition. Use a new function name to avoid this error. For example, f(x):=f(x) + 5 will result in the stack overflow error but can be changed to f2(x):=f(x)+2.

As a rule, you should not have the same function name on both sides of a ":=" unless you intend to define the function recursively.


Can't evaluate this expression. It may have resulted in an overflow...

Can't evaluate this expression. It may have resulted in an overflow or an infinite loop.

This function definition may contain too many nested functions. Or, if the function is defined in terms of itself, it may be stuck in an infinite loop. For example, if you define a function such as f(x):=f(x)+5 and evaluate it by typing f(10)=, you will see this message. To avoid this problem, be careful when redefining a function in terms of itself.


Can't evaluate this function when its argument is zero.

Can’t evaluate this function when its argument is zero.

This function is undefined at zero.


Can't find the data file you're trying to use.

Can’t find the data file you’re trying to use.

The worksheet cannot find the data file or other type of file you are referencing. Make sure the file exists in the location you've specified.

If you are using a function such as READPRN or WRITEPRN, make sure you typed the argument as a pathname to the data file.


Can't have more than one array in a contour plot.

You entered more than one array in the placeholder of a contour or surface plot. You can only have one array at a time in that placeholder because contour and surface plots can only represent a single surface at a time.


Can't perform this operation on entire array.

Can’t perform this operation on the entire array at once. Try using “vectorize” to perform it element by element.

One of the functions or scalar.

For example, you see this message if you try to divide one vector by another.

If you want to apply a function or operator to every element in a vector or matrix, use the vectorize operator.


Can't solve a system having this many equations.

Can’t solve a system having this many equations.

You cannot have this many equations in a solve block. You can solve nonlinear systems of up to 200 variables and linear systems of up to 500 variables. With the Solving and Optimization Extension Pack (Expert Solver) for Mathcad you can solve nonlinear systems of up to 250 variables, linear systems of up to 1000 variables, and quadratic systems of up to 1000 variables.


Can't understand something in this data file.

Can’t understand something in this data file. If this file came from a spreadsheet, make sure you saved it as ASCII text only.

The file you are trying to access with READ or READPRN does not have the required format:

  • The file must be ASCII with spaces or tabs separating the numbers.

  • All lines in the data file must have the same number of values if you are using READPRN. (Lines containing no values are ignored.)

If the file has the required format and you continue to see this error, try removing any text from the file.


Can't understand the name of this function.

Can’t understand the name of this function. If you’re trying to use multiply, use “*”.

You have:

  • Used an expression as if it were a function, and

  • That expression forms an invalid function name.


Can't understand the way this range variable is defined.

Can’t understand the way this range variable is defined.

You defined a range variable with a range that couldn't be understood. When you define a range, you must use one of the following forms:

Rvar := n1 ..n2 (type Rvar:n1;n2)

Rvar := n1,n2 ..n3 (type Rvar:n1,n2;n3)

You can use at most one comma and one semicolon in the definition of a range for a range variable. If you use the second form, the value of n2 must lie between the values of n1 and n3, but not equal n1.


Can't use a range variable in a solve block.

Can’t use a range variable in a solve block.

You'll see this message when you use a range variable in an inappropriate place, for example a solve block.

If you want to iterate with a solve block, try defining the function in terms of the solve block and using that function for iteration.


Cannot evaluate this accurately at one or more of the values...

Cannot evaluate this accurately at one or more of the values you specified.

These error messages indicate that you tried to evaluate a function for a value beyond the accurate range for the function.

For example, you see this message if you try to evaluate sin(10^100). Since the value of sin(10^100) depends on the ones digit of 10^100, any value that comes back would have no significant digits. Instead of seeing a value of dubious accuracy, you'll see one of these error message.


Can't have anything with units or dimensions

Can’t have anything with units or dimensions here.

This expression uses units somewhere units are not permitted.

Units are not permitted:

  • in the arguments of most functions,

  • in exponents,

  • in subscripts and superscripts.

If you want to use an expression with units, you can first divide the expression by the UnitsOf(expression) so the units are cancelled out.


Can't understand this number.

Can’t understand this number.

This expression contains a digit or a decimal point where it is not allowed. For example, if you accidentally type .452. you will see this error.


Catalan's Constant


Cauchy Distribution

Distribution generators for the Cauchy Equation:

dcauchy(x,l,s) Returns the probability density.

pcauchy(x,l,s) Returns the cumulative probability distribution.

qcauchy(p,l,s) Returns the inverse cumulative probability distribution.

rcauchy(m,l,s) Returns a vector of m random numbers having the Cauchy distribution.


Changing Axis Limits of Polar Plots

Changing radial axis limits of polar plots

To override the default radial axis limits:

  1. Click in the polar plot to select it. You'll see two additional numbers on the right of the polar plot.

  2. To set the origin of the polar plot, click on the lower number and type a new number.

  3. To set an axis limit for the perimeter of the plot, click on the number in the top placeholder and type in a new number.

  4. Click outside the plot region.

You cannot override the default angular axis limits. These are always set to 0 degrees and 360 degrees.


Changing Axis Limits of X-Y Plots

To override the default axis limits:

  1. Click in the plot to select it. You'll see four numbers, one by each axis limit.

  2. To set the axis limit on the horizontal axis, click on the number below the appropriate x-axis limit and replace it with the number at which you want the axis to end.

  3. For the vertical axis, do the same thing to the number to the left of the appropriate axis limit.

  4. Click outside the plot region to redisplay the plot using the numbers you specified as axis limits.


Changing Printers

To redirect your printout to a file or to a different printer:

  1. Choose Print from the File menu to bring up the Print dialog box.

  2. Click on "Print Setup" to bring up the Print Setup dialog box. Specify the printer of your choice. Then click "OK."

  3. To redirect your printout to a file, click on the "Print to file" checkbox.


Changing the Appearance of a Control

To change the appearance of a Mathsoft Control component:

  1. Right-click on the component and select Mathsoft (Control) Object Þ Properties from the pop-up menu.

  2. In the Properties dialog box you will see various options that let you change the appearance of the control. For example, for a Mathsoft Button Control, you can change the default check box to a push button within this dialog box. Make your selections.

Figure 1: Mathsoft Button Control Properties dialog box

  3. Click "Apply" to keep the Properties dialog box open and preview the changes in your worksheet. Click "OK" to close the Properties dialog box and return to the worksheet.

Note:

  • To customize a button quickly with a specific graphic image, create an image and copy it into your clipboard. Right-click on your Mathsoft Control component and select Mathsoft (Control) Object Þ Paste Bitmap from the pop-up menu. Alternatively, you can browse for a bitmap or icon file through the Pictures tab in the Properties dialog box.


Changing the Color in which Equations or Text are Highlighted

By default, the background color directly under a highlighted region is yellow. To change this for all highlighted regions:

  1. Choose Color / Highlight from the Format menu.

  2. Select a color in the resulting dialog box or click "Define Custom Color" to blend your own color.

Note that this will affect all highlighted regions throughout your worksheet. To change the highlight color for selected regions:

  1. Click on a selected region.

  2. Choose Properties from the Format menu.

  3. Click on the Display tab.

  4. Click “Choose Color” to choose a highlight color other than the default.

  5. Click “OK.”


Changing the Color of Highlighted Edits in an E-book

By default, Mathcad highlights any changes you make to your Electronic Book in a different color.

To specify this color:

  • Choose Color / Annotation from the Format menu.

Mathcad shows a toolbar of colors to choose from.


Changing the Display of an Operator

When you insert an operator into a worksheet, it has a certain default appearance. There are some whose appearance you can control. These include:

Definition symbol
Global definition symbol
Multiplication
Derivative
Literal subscript
Equal to

To change the way any of these operators is displayed throughout a worksheet:

  1. Choose Worksheet Options from the Tools menu.

  2. Click the Display tab and use the drop-down options next to each operator to select a display option.

  3. Click “OK.”

To change the appearance of an operator in one or more individual expressions:

  1. Click on the operator with the right mouse button.

  2. Choose View [operator name] As from the pop-up menu.


Changing the Font for All Constants

To change the font for all constants in a worksheet at once:

  1. Choose Equation from the Format menu.

  2. In the dialog box, make sure the Style Name is set to Constants.

  3. Click on "Modify" and choose from among the various font characteristics available.

  4. Click "OK" to assign the font characteristics to all the constants in your worksheet.

  5. You may want to consider changing the font for all variables for aesthetic reasons.

If you want to change the font of a particular constant rather than the font of all constants, you must give that constant its own user-defined style.


Changing the Font for All Variables

To change the font for all variables in a worksheet at once:

  1. Choose Equation from the Format menu.

  2. In the dialog box, make sure the Style Name is set to Variables.

  3. Click on "Modify" and choose from among the various font characteristics available.

  4. Click "OK" to assign the font characteristics to all the variables in your worksheet.

  5. You may want to consider changing the font for all constants for aesthetic reasons.

If you want to change the font of a particular variable rather than the font of all variables at once, you must give that variable its own user-defined style.


Changing the Font of a Particular Variable or Constant

To change the font of a particular variable or constant, you have to change its style. There are two steps to this procedure. The first is required and the second is optional.

Apply a different math style to the selected variable or constant

Change the font properties associated with that math style

Note that variable names are font sensitive. For example, if you have a statement like "x := 1" in your worksheet and you change its tag so that it looks like "x := 1", any x's further down in the worksheet will be undefined. You'll need to retag them to look like "x".


Characteristics of Symbolic Math

When you want an algebraic expression returned as an answer, you use symbolic math. If you want a number returned as an answer, you are calculating numerically.

Some advantages to using symbolic math are:

  • You can explicitly see relationships between variables.

  • The results are immune from round-off errors, numerical instabilities, and other problems inherent in numerical calculation.

Some problems that you may encounter when doing symbolic math are:

  • The resulting expressions can become very complicated.

  • It can be difficult to control exactly what form the answer takes.


Characters Allowed in Variable and Function Names

Variable and function names can consist of:

  • Upper and lowercase letters
  • Numbers 0 through 9
  • The infinity symbol
  • The prime symbol ` (keystroke Ctrl+F7)
  • Greek letters
  • Underscores ( _ )
  • Percent symbols ( % )
  • Subscripts


Characters You Can Find and Replace

You can use the Find dialog box to locate a variety of numbers, letters, and other characters in a worksheet. You can find numbers and letters in any region of a worksheet. You can find other characters, such as parentheses, in text regions and strings. Use the table below to see what characters you can search for in which regions.

Supported Character: | How to type in the dialog box: | Regions searched:
Letters and numbers | Letters and numbers | All
Greek letters | Type \ followed by the roman equivalent | Math
Period | Type . | All (In Math, finds the literal subscript operator)
Parentheses | Type ( or ) | Text and strings
Comma | Type , | Text and strings
Space | Press the Spacebar | Text and strings
Plus and minus | Type + or - | Text and strings
Tab | Type ^t | Text
Return | Type ^p | Text
Caret | Tyep ^ | Text and strings
Line break | Type ^L | Text
Backslash | Type ^\ | Text


Chebyshev Polynomial Functions

Tcheb(n,x) Returns the value of the Chebyshev polynomial of degree n, of the first kind, at x.

Ucheb(n,x) Returns the value of the Chebyshev polynomial of degree n, of the second kind, at x.

Arguments:

n is a non-negative integer.

x is a real scalar.

The Chebyshev polynomial of the first kind arises as a solution to the differential equation:

The Chebyshev polynomial of the second kind arises as a solution to the differential equation:


Check Spelling Dialog Box

When the spell-checker finds a misspelled word, it brings up the Check Spelling dialog box. The spell-checker considers a word misspelled when it is not found in its dictionary.

The following options are available in the Check Spelling dialog box:

Not Found

This word was not found in the dictionary. It may be misspelled.

Change To

Lists suggested replacements for the misspelled word. Select one and click "Change" to replace the misspelled word with the selected replacement.

Ignore

Leaves the misspelled word as is, click "Ignore" or "Add." If you click on "Ignore," the spell-checker leaves the word alone.

Change

Changes the misspelled word to the suggested replacement in the "Change To" box.

Add

Leaves the misspelled word as is and continues spellchecking. Adds the word to the dictionary. The spell-checker will then consider it spelled correctly for future spellchecks.

Suggest

Shows additional but less likely replacements.


Checking for Reasonable Results

For simple calculations, just use common sense. For more complicated calculations, Include redundancy checks in your documents to estimate whether results are approximately correct.


Chemistry Notation

If you want a variable name to contain an operator (such as subscripts or superscripts or any other operator), you must use a special mode, most often used for chemistry notation:

  1. Press Ctrl+Shift+J. This inserts a pair of brackets with a placeholder between them.

  2. Type whatever letters, numbers, and operators are in the name.

Example:

You can create variable definitions such as the following:


Chi-Squared Distribution

Distribution generators forthe Chi-squared Equation:

dchisq(x,d) Returns the probability density.

pchisq(x,d) Returns the cumulative probability distribution.

qchisq(p,d) Returns the inverse cumulative probability distribution.

rchisq(m,d) Returns a vector of m random numbers having the chi-squared distribution.


Cholesky Decomposition

cholesky(M) Returns the lower triangular matrix L such that [image].

Arguments:

  • M must be symmetric.

  • This function uses only the upper triangular part of M.

Launch QuickSheet Example


How to Type the Equal Sign for Definition

Click anywhere in the expression and press : (the colon key).


Clipboard

The 'clipboard' is a temporary storage location in your operating system.

To place something on the clipboard, select it, pull down the Edit menu, and choose

  • Cut to remove it from the worksheet and put it on the clipboard.

  • Copy to put it on the clipboard without removing it from the worksheet.

When you cut or copy to the clipboard, the previous contents of the clipboard are discarded.

To put whatever is on the clipboard into your worksheet, choose Paste or Paste Special from the Edit menu.


Close

Closes the Print Preview screen and brings up the main Worksheet Window.


Closing a Worksheet Window

Choose Close from the File menu.


Help - User Forums

The Mathcad Collaboratory User Forums are maintained by Mathsoft for Mathcad users. The Collaboratory User Forums is a place for you to find others with similar interests and issues. You can post questions, upload or download Mathcad and other files, and connect with Mathcad users around the world. Follow and participate in threaded discussions in a variety of discipline and topic forums.

You can connect to the Collaboratory User Forums at http://collab.mathsoft.com/~mathcad2000.


Collapsing the Area You've Designated

Once you've inserted an area, you can collapse it to hide the regions inside. To do so:

1. Click on one of the area boundaries with the right mouse button.

2. Choose Collapse from the pop-up menu. The area boundaries and the regions between them collapse into a single bar:

Regions below the collapsed area move up as necessary.

Notes:

  • You can select and drag the collapsed bar and change its appearance, but you cannot delete or copy it.

  • Regions inside a collapsed area still calculate, but you cannot see them on the screen. To see the regions again, you must expand the area.

  • To prevent others from expanding a collapsed area, you must lock it.


Collecting Terms

To express a sum of terms as a polynomial in a particular variable:

  1. Select a variable name or the name of a function together with its argument by placing it between the editing lines.

  2. Choose Collect from the Symbolics menu.

This will rewrite the sum as a polynomial in that variable or function.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "collect" keyword and live symbolic evaluation instead.


Collections

  • Inputs and Outputs are predefined collections of DataValue objects containing the Scriptable Object’s inputs and the outputs, respectively.

  • The Count property can be used to query the total number of elements in the collection. For example, Outputs.Count returns the number of output variables.

  • The Item method is used to specify an individual element in the collection. To refer to a particular input or output, use the notation Inputs.Item(n) or Outputs.Item(n), where n is the index of the input or output. The index n always starts from 0. Since Item is the default method, languages such as VBScript and JScript let you drop the method name to imply the default method. For example, Inputs(0) is equivalent to Inputs.Item(0) and references the first input.

Note: In JScript, the names of functions, methods, objects, and properties are case sensitive, while in VBScript they are not.


Color Settings (3D Bar Plots)

To control the color of a 3D bar plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Fill the bars with a solid color or according to a colormap

    • Fill the bars with a color from a colormap according to the x, y, or z values.

    • Remove all fill color

    • Make the colors of the surface blend smoothly

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Color Settings (Contour Plots)

To define the shading of a contour plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Fill the plot with color according to a colormap

    • Remove color

    • Fill the contours using 1/2 filled connected surfaces

    • Make the colors of the plot blend smoothly

  4. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Color Settings (Surface Plots)

To control the color of a surface plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Fill the surface with a solid color or according to a colormap

    • Fill the contours of the surface with a colormap

    • Remove all fill color

    • Draw the surface using 1/2 filled connected surfaces

    • Make the colors of the surface blend smoothly

  4. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Color Settings (Vector Field Plots)

To control the color of the arrow heads in a vector field plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Fill the arrows with a solid color or according to a colormap

    • Remove color from the arrows

  4. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Colormap

A colormap is a file consisting of data which match different levels of a plot to different colors. Mathcad comes with a variety of colormaps which let you apply rainbow colors, or shades of gray, red, blue, and green. You can also create your own.

A colormap file is a *.CMP file containing three columns of values which represent levels of red (column 1), green (column 2), and blue (column 3).

There are usually 256 rows in a colormap. Each row of values specifies a color consisting of red, green, and blue to which a grayscale value is mapped. If there are fewer than 256 rows in the colormap, Mathcad linearly interpolates over 256 values.

Each value in a colormap should be an integer between 0 and 255, inclusive. Any value that is not an integer is truncated. Any value that is not between 0 and 255 is increased to 0 or decreased to 255.

By default, Mathcad checks the CMAPS folder in your Mathcad folder for *.CMP files. You can apply a colormap file to a 3D plot by choosing it in the 3D Plot Format dialog box. There are some colormaps provided in the CMAPS folder. You can also create your own colormaps using the SaveColormap function.

Note:

Some built-in colormaps such as Rainbow and Grayscale do not appear as *.CMP files in the CMAPS folder.


Combinations

combin(n,k) Returns the number of subsets each of size k that can be formed from n objects. Each subset is known as a combination.

Arguments:

n and k are integers greater than or equal to 0.

n must be greater than or equal to k.

Notes:

  • Combinations and permutations are similar since they are both subsets of items. However, internal order is significant in a permutation but not in a combination.

  • The number of combinations is usually denoted [image].

The definition of a combination is:


Combinatorical functions

combin(n,k)

Returns the number of combinations of n objects taken k at a time.

permut(n,k)

Returns the number of permutations of n objects taken k at a time.


Compatible Mail System

Compatible electronic mail programs need to be MAPI-compliant. Examples are Microsoft Exchange, Microsoft Mail, or Eudora.


Complex Arguments

Complex arguments to the exponential function are given by:

Complex arguments to the natural log function returns:


Complex conjugate operator

Complex conjugate

keystroke: "

Returns the conjugate of x:

Re(x) - i Im(x)

Operands:

x must be a scalar.


Complex Number Functions

Re(Z) Real part of Z

Im(Z) Imaginary part of Z

arg(z) Argument of z, between -p and p including p.

Arguments:

  • Z can be a real or complex scalar or matrix.

  • z can be a real or complex scalar.

See: Arrays as arguments.


Functions for Complex Numbers

Re(Z)

Returns the real part of Z

Im(Z)

Returns the imaginary part of Z

arg(z)

Returns the argument of z, between -p and p.

csign(z)

Returns 0 if z=0, 1 if Re(z)>0 or (Re(z)=0 and Im(z)>0), -1 otherwise.

signum(z)

Returns 1 if z=0 and z/|z| otherwise.


Complex vs. Real fft's

Use the fft/ifft pair if both of the following statements are true:

The time domain data is real.

The data vector has [image] elements (m>2).

Use the cfft/icfft pair if any of the following statements are true:

The time domain data is complex

The data vector does not have [image] elements

The data is in a matrix, not a vector.

For real data in the time domain, the Fourier transform has conjugate symmetry. Because of this, fft will drop the redundant second half of the result to increase the speed of the calculation. This is why the vector returned by fft is half the size of the original vector.

The ifft function reconstructs this redundant half. For this reason, you should use fft and ifft together.

The cfft/icfft pair makes no such assumptions about symmetry. Although these functions are not as efficient for real data, they can be used.

The same information applies to FFT/IFFT and CFFT/ICFFT, which are normalized by 1/n instead of 1/sqrt(n).


Component Wizards

When you insert some components, such as the Excel component, you’ll see a Setup Wizard. The Setup Wizard lets you specify certain properties of the component before it is inserted.

  • Press the “Next” button to continue through the Wizard.

  • Press the “Back” button to go back to a previous page.

  • Click the “Finish” button to insert the component into your worksheet.


Condition Number of a Matrix

cond1(M) Returns the condition number of the matrix M based on the [image] norm.

cond2(M) Returns the condition number of the matrix M based on the [image] norm.

conde(M) Returns the condition number of the matrix M based on the Euclidean norm.

condi(M) Returns the condition number of the matrix M based on the infinity norm.

Arguments:

  • M must be a square matrix.

Launch QuickSheet Example


Configuring a Component

You may occasionally need to set up the component’s properties so that the component knows how to handle any inputs it’s getting from Mathcad and what to send as output. To configure the properties for a component:

  1. Click on the component once to select it.

  2. Click on it with the right mouse button to see a pop-up menu. The options on the pop-up menu depend on the component you selected, but usually you’ll see the commands Cut, Copy, and Properties.

  3. Choose Properties from the pop-up menu.

The settings in the Properties dialog box depend on the component you clicked on.


Confluent Hypergeometric Function

mhyper(a,b,x) Returns the value of the confluent hypergeometric function, 1F1(a;b;x) or M(a,b,x).

Arguments:

a and b are real scalars.

x is a real scalar.

The confluent hypergeometric function is the solution to the differential equation:

Many functions are special cases of the confluent hypergeometric function. For example:

exp(x)=mhyper(1,1,x)

exp(x).sinh(x)=x.mhyper(1,2,2.x)


Conjugate gradient method for solving

The Conjugate Gradient method is one of the nonlinear methods to use with the find, minerr, minimize, and maximize functions.

For more information on the method behind the Conjugate Gradient option, see the solver references.


Constants Style

This is the default math style assigned to any constant you type in the worksheet.


Context Sensitive Help

You can get context sensitive help while working on a worksheet:

  • For menu commands, click on the command and read the message line at the bottom of the window.

  • For toolbar or palette buttons, hold the pointer over the button momentarily to see a tool tip.

  • For an error message, built-in function or variable, or operator, click on it and press F1.

  • For help on menu items, press Shift F1. After the pointer to a question mark, click on a menu command. To resume editing, press Esc so that the pointer changes back to an arrow.


Contour Plots on Other Planes

By default, when you create a contour plot, you see the z contours projected onto the XY backplane. When you create a graph of a contour plot and at least one other kind of plot, however, you can view the x or y contour lines on the XZ or YZ backplanes. To do so:

  1. Double-click on the graph of more than one plot to open a tabbed dialog box.

  2. Click on the Special tab to open the Special page. Click on the tab corresponding to the contour plot. (ie. click on Plot 1, Plot 2, etc.)

  3. Choose a contour direction from the drop-down menu at the bottom of the Contour Options section. Choose X-Contours to see the contours on the XZ backplane. Choose Y-Contours to see the contours on the YZ backplane.

  4. Click Draw Lines in the Contour Options and/or click Fill to fill the contours with color.

  5. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.

Note:

When formatting contours other than the z contours, choose the contour direction from the drop-down menu before setting any of the other format options.


Controlling How Data is written Using File Access Functions

Controlling How Data is Written

Significant digits:

By default, WRITEPRN writes 4 significant digits to disk. You can change this by changing the value of PRNPRECISION. To do so, choose Worksheet Options from the Tools menu and go to the Built-in Variables tab.

Column width:

By default, WRITEPRN writes data in columns that are 8 digits wide. You can change this by changing the value of PRNCOLWIDTH. To do so, choose Worksheet Options from the Tools menu and go to the Built-in Variables tab.


Controlling Iterations in a Loop

Program loops are designed to continue until a certain condition is met or after a certain number of iterations. However, you may want to halt a loop during a certain iteration and continue with the next iteration. To do so, use a continue operator.

To insert a continue operator:

  1. Click on a placeholder into which you want to place the continue operator.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the continue button or press [Ctrl] + [. Do not just type the word "continue".

  4. When the program encounters a continue, it halts the current iteration and resumes execution of the program with the next iteration.


Controlling the Accuracy of Calculation using TOL

TOL (Default = 0.001)

This controls the precision to which integrals and derivatives are evaluated. It also controls how long iteration in solve blocks and in the root function will go on for.

Setting TOL low

When you make TOL very low, all results are computed with much greater precision. Depending on the numerical properties of the expression this may increase computation time.

You may also see a did not find solution error message when the numerical properties of the expression are such that a solution asymptotically approaches a number that exceeds the acceptance threshold set by TOL.

Setting TOL high

High values of TOL will decrease computation time at the expense of precision.

Launch QuickSheet Example


Controlling the Accuracy of Constraints Using CTOL

CTOL (Default = .001)

This controls how closely a constraint in a solve block must be met for a solution to be acceptable. A solve block controlled by CTOL consists of the word Given, one or more constraints to be met, and an optimizing function: minimize, maximize, find, or minerr. In order for the function to return a solution, the constraints in the solve block must be satisfied. For example, a constraint such as x<2 needs to be satisfied before a solution is returned. If CTOL=.001, this constraint is satisfied if x<2.001.

Change the value of CTOL to control the precision of the solution. The larger the value of CTOL, the less precise the solution may be. For smaller values of CTOL, a more precise solution is found, but the time needed to find a solution may increase.

To redefine CTOL...


Controlling the Display of a Particular Result

To change the display of a particular number you need to change the local result format. To do so:

  1. Choose Result from the Format menu or double-click on the result to see the Result Format dialog box.

  2. Make sure that the button labeled "Set as default" is NOT checked.

  3. Make the necessary changes to the Result Format dialog box and click "OK."

If you check "Set as default" the changes you make affect all the results in the worksheet.


Controlling the Display of All Results

Formatting Numerical Results

To change the default display of all numerical results in a worksheet you need to change the numeric format for the worksheet. To do so:

  1. Click in an equation.

  2. Choose Result from the Format menu to see the Result Format dialog box.

  3. Make the necessary changes to the Result Format dialog box and click "OK."


Controlling the Editing Lines

Use the arrow keys to move the editing lines in the direction indicated by the arrow.

To change what's enclosed between the editing lines:

Press Space to cycle through the various parts of the expression that could go between the editing lines given their current location.

If no step in the cycle encloses the right part of the expression, click on a name or number elsewhere in the expression and try it again. Each starting location for the editing lines spawns a whole new cycle in which the intermediate states enclose different parts of the expression.


Controlling the Help Window

By default, the left-hand part of the Help window contains tabs for accessing a Table of Contents, an Index, and a full-text searching mechanism. You can, however, choose to hide this window. You can also force the Table of Contents and the Index to show only certain categories of topics.

To hide the left-hand window:

  • Click the [image] button.

To re-display the window click the [image] button.


Convert to Partial Fraction

Generates a partial fraction expansion for an expression. If such an expansion is found, the denominators are linear or quadratic in the selected variable.

Launch QuickSheet Example


Converting from cylindrical to rectangular

cyl2xyz(r, q, z) Converts the cylindrical coordinates of a point (r,q,z) to rectangular coordinates (x,y,z). Returns a vector whose elements are x, y, and z

Arguments:

(r, q, z) are the cylindrical coordinates of a point in space.

Examples:

The angles in the example above are in degrees. For angles in radians, enter the values without using the unit "deg".

Launch QuickSheet Example


Converting from polar to rectangular

pol2xy(r, q) Converts the polar coordinates of a point (r, q) to rectangular coordinates (x,y). Returns a vector whose elements are x and y.

Arguments:

(r, q) are the rectangular coordinates for a point on a plane.

The angle in the example above is in degrees. For angles in radians, enter the values without using the unit "deg".

Launch QuickSheet Example


Converting from rectangular to cylindrical or spherical

xyz2cyl(x,y,z) Converts the rectangular coordinates of a point (x,y,z) to cylindrical coordinates (r, q, z). Returns a vector whose elements are r, q, and z.

xyz2sph(x,y,z) Converts the rectangular coordinates of a point (x,y,z) to spherical coordinates (r, q, f). Returns a vector whose elements are r, q, and f.

Arguments:

(x,y,z) are the rectangular coordinates of a point in space.

Examples:

The angles in the example above are in degrees. For angles in radians, enter the values without using the unit "deg".

Launch QuickSheet Example


Converting from rectangular to polar

xy2pol(x,y) Converts the rectangular coordinates of a point (x,y) to polar coordinates (r, q). Returns a vector whose elements are r and q.

Arguments:

(x,y) are the rectangular coordinates for a point on a plane.

The angle in the example above is in degrees. For angles in radians, enter the values without using the unit "deg".

Launch QuickSheet Example


Converting from spherical to rectangular

sph2xyz(r, q, f) Converts the spherical coordinates of a point (r, q, f) to rectangular coordinates (x,y,z). Returns a vector whose elements are x, y, and z.

Arguments:

(r, q, f) are the spherical coordinates of a point in space.

Examples:

The angles in the example above are in degrees. For angles in radians, enter the values without using the unit "deg".

Launch QuickSheet Example


Converting to Degrees

The inverse trigonometric functions and the angle function all return angles in radians. You can use the units placeholder at the end of an equation to convert the result to degrees instead. The example below shows how:

Launch QuickSheet Example


Coordinate System Functions

Polar and Rectangular

xy2pol(x,y)

Converts the rectangular coordinates of a point (x,y) to polar coordinates (r, q).

pol2xy(r, q)

Converts the polar coordinates of a point (r, q) to rectangular coordinates (x,y).

Spherical and Rectangular

sph2xyz(r, q, f)

Converts the spherical coordinates of a point (r, q, f) to rectangular coordinates (x,y,z).

xyz2sph(x,y,z)

Converts the rectangular coordinates of a point (x,y,z) to spherical coordinates (r, q, f).

Cylindrical and Rectangular

cyl2xyz(r, q, z)

Converts the cylindrical coordinates of a point (r,q,z) to rectangular coordinates (x,y,z).

xyz2cyl(x,y,z)

Converts the rectangular coordinates of a point (x,y,z) to cylindrical coordinates (r, q, z).


Copying a Matrix of Numerical Results

Copying a Matrix or Vector of Numerical Results

If the result to the right of an equal sign is a matrix or vector, you must copy the entire matrix or vector at once. To do so:

  1. Click on the result to place it between the editing lines.

  2. Choose Copy from the Edit menu. This copies the numerical result to the clipboard with the precision displayed.

After copying a matrix or vector, you can paste it someplace else in your worksheet or into most other applications.

Note: To copy only part of an array, you must first display it as an output table.


Copying a Numerical Result

To copy a single numerical result:

  1. Click on the result. This will place it between the editing lines.

  2. Choose Copy from the Edit menu. This copies the numerical result to the clipboard using the precision displayed.

After copying a numerical result, you can paste it someplace else in your worksheet or into another application.


Copying from the Help System

To copy text from the Help:

  1. Select the text by holding the mouse button down and dragging the mouse across it.

  2. Click on the selected text with the right mouse button.

  3. Choose Copy from the pop-up menu.


Copying Results of Calculation (generally)

Copying Results of Calculation

Copying a numerical result

Copying a matrix

Copying from a scrolling table of numbers

Limitations on copying numerical results


Copying Values from an Output Table

To copy one or more values from an output table:

  1. Select a group of values.

  2. Click on the selection with the right mouse button and choose Copy Data from the pop-up menu. This copies the numerical result to the clipboard with the precision displayed.

After copying one or more values from an output table, you can paste them into your worksheet or into most other applications.


Correlation Function

Correlation

corr(A,B) Returns the Pearson's r correlation coefficient of the elements in A and B. In Mathcad, it is calculated as

See related definitions of the covariance and standard deviation for more information.

Arguments:

A and B are m x n arrays.

Other functions for data analysis...

Launch QuickSheet Example


Cosine Integral


Could not find a solution because the root finder failed.

Results from some differential equation solvers such as sbval (a function which finds missing initial conditions), require iteration. If, after many iterations successive iterations, estimates still differ substantially, you'll see this error message. Try using different guess values.


Covariance Function

Covariance

Arguments:

A and B are both m x n arrays.

Note that this function divides by mn rather than mn-1 in computing the covariance. To find the covariance corresponding to a denominator of mn-1, multiply the result of this function by mn/(mn-1).

Other functions for data analysis...

Launch QuickSheet Example


CreateMesh Function

CreateMesh(F (or G, or f1, f2, f3), s0, s1, t0, t1, sgrid, tgrid, fmap)

Returns a nested array of three matrices representing the x-, y-, and z-coordinates of a parametric surface defined by the function F, G, or the set of functions f1, f2, and f3. All arguments but the function argument are optional.

Click here to see an example using CreateMesh.

Arguments:

  • F is a three-element vector-valued function of two variables, u and v.

  • G is a scalar-valued function of two variables, u and v.

  • f1 is a scalar-valued function of two variables, u and v.

  • f2 is a scalar-valued function of two variables, u and v.

  • f3 is a scalar-valued function of two variables, u and v.

  • s0 is the real lower bound of the range for the independent variable, u. The default value is -5.

  • s1 is the real upper bound of the range for the independent variable, u. The default value is 5.

  • t0 is the real lower bound of the range for the independent variable, v. The default value is -5.

  • t1 is the real upper bound of the range for the independent variables, v. The default value is 5.

  • sgrid is the integer number of gridpoints in u. The default value is 20. sgrid>0

  • tgrid is the integer number of gridpoints in v. The default value is 20. tgrid>0

  • fmap is a real three-element vector-valued function of three variables that defines a mapping from any coordinate system to Cartesian coordinates (default is the identity map, i.e. fmap_default(e1, e2, e3) := c(e1, e2, e3)).

Notes:

  • Only real-valued functions are allowed.

  • The number of cells in the grid created is (sgrid-1).(tgrid-1).

  • CreateMesh is used internally by Mathcad when making 3D QuickPlots of functions of two variables.

  • A typical function F might look like this:

    The function F must consist of three elements.

  • A typical function G might look like this:

  • Typical f1, f2, and f3 functions might look like this:

  • If s0 and s1 are explicitly specified, then t0 and t1 must likewise be specified, and vice versa

  • There are two built-in mapping functions, which may be used in the argument fmap: sph2xyz and cyl2xyz. These functions map from spherical polar and circular cylindrical coordinate systems, respectively, to Cartesian coordinates. They can also be called in the worksheet to perform a coordinate system transformation.

  • fmap may be defined as either a function of three scalars or a function of a single vector. Here are two examples:

Launch QuickSheet Example


CreateSpace Function

CreateSpace(F (or f1, f2, f3), t0, t1, tgrid, fmap) Returns a nested array of three vectors representing the x-, y-, and z-coordinates of a space curve defined by the function F. All arguments but the function argument are optional.

Click here to see an example using CreateSpace.

Arguments:

  • F is a three-element vector-valued function of one variable, t.

  • f1 is a scalar-valued function of one variable, t.

  • f2 is a scalar-valued function of one variable, t.

  • f3 is a scalar-valued function of one variable, t.

  • t0 is the real lower bound of the domain for t. The default value is -5.

  • t1 is the real upper bound of the domain for t. The default value is 5.

  • tgrid is the integer number of gridpoints in t. The default value is 20. tgrid>0

  • fmap is a real three-dimensional vector-valued function of three variables that defines a mapping from any coordinate system to Cartesian coordinates (default is the identity map, i.e. fmap_default(e1, e2, e3) := c(e1, e2, e3)).

Notes:

  • Only real-valued functions are allowed. An error will be issued if a call is made with a complex-valued function or functions.

  • The number of cells in the grid created is tgrid-1.

  • CreateSpace is used internally by Mathcad when making 3D QuickPlots of functions of one variable.

  • A typical function F might look like this:

    The function F must consist of three elements.

  • Typical f1, f2, and f3 functions might look like this:

  • There are two built-in mapping functions, which may be used in the argument fmap: sph2xyz and cyl2xyz. These functions map from spherical polar and circular cylindrical coordinate systems, respectively, to Cartesian coordinates. They can also be called in the worksheet to perform a coordinate system transformation.

  • fmap may be defined as either a function of three scalars or a function of a single vector. Here are two examples:


CreateSpace Example

Let us use the following function as an example:

You graph the function F by typing the function name below the function definition and selecting Graph / 3D Scatter Plot from the Insert menu. This results in a 3D scatter plot of the function that uses the following defaults: a range of -5 to 5 for t with 20 points and a Cartesian mapping.

Let us say you want to increase the range for t to -10 to 10 in this plot, and increase the number of grids in t. You can use the CreateSpace function to do this as follows:

The changes are clearly visible in the graph. Indeed, the increase in the number of dots in the scatter plot coupled with the increase in range and a slight rotation of the graph makes the helical nature of the plot more apparent.

It is not necessary to assign each argument of CreateSpace to a variable, but it is good style to do so.


Creating a 3D Bar Plot

To create a 3D bar plot of a function (called a QuickPlot):

  1. Define the function or set of functions.

  2. Choose Graph / 3D Bar Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the function or set of functions in the placeholder. If you enter a set of function names, enclose them in parentheses.

A 3D bar plot of the function is created using default ranges and grids for the independent variables. To change them, double-click on the graph and use the options in the QuickPlot Data tab of the 3D Plot Format dialog box.

To create a 3D bar plot of data:

  1. Define the matrix of elements to plot. The matrix must have at least two rows and two columns.

  2. Choose Graph / 3D Bar Plot from the Insert menu to create a 3D bar plot region.

  3. In the placeholder , enter the name of the matrix to plot.

  4. Click outside of the plot region.

A perspective view of the matrix is drawn as a two-dimensional grid lying flat in three-dimensional space. Each matrix element is represented as a column at a specified height above or below this grid.

Notes:

  • Complex or imaginary points are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

  • To create a 2D bar chart, create an X-Y plot and change the "Type" for the Trace Settings to "Bar."


Creating a Color BMP File

WRITERGB(“file”) Writes an array to file. The array must be an array of integers between 0 and 255 inclusive containing 3n columns. The first n/3 columns represent the red component of image in file.bmp in the current directory. The second and third sets of n/3 columns represent the green and blue components of the same image.

Arguments:

file is either the pathname to a BMP file.

file is entered as a string.

Launch QuickSheet Example


Creating a Contour Plot

To create a contour plot of a function (called a QuickPlot):

  1. Define the function or set of functions.

  2. Choose Graph / Contour Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the function or set of functions in the placeholder. If you enter a set of function names, enclose them in parentheses.

A contour plot of the function is created using default ranges and grids for the independent variables. To change them, double-click on the graph and use the options in the QuickPlot Data tab of the 3D Plot Format dialog box.

To create a contour plot of data:

  1. Define the matrix of values to plot The matrix must have at least two rows and two columns. For best results, the rows and columns should represent equally spaced intervals on the axes.

  2. Choose Graph / Contour Plot from the Insert menu to create a contour plot region.

  3. Place the name of the matrix in the placeholder.

The values of the matrix are linearly interpolated to form level curves in such a way that no two cross. The matrix is plotted by rotating it so that the (0,0) element is at the lower-left corner. Thus the rows of the matrix correspond to the values on the x-axis, increasing to the right, and the columns correspond to the values along the y-axis, increasing toward the top.

Notes:

  • Complex or imaginary points are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

  • Alternatively you can create a contour plot from a set of x, y and z data points. First create three vectors: one containing the x values, one containing the y values, and one the z values. Create a contour plot region and type the names of the x, y and z vectors separated by commas into the placeholder. The generated contour plot is the same as a 3D scatter plot changed into a contour plot.


Creating a Grayscale BMP File

WRITEBMP(“file”) Writes an array to file. The array must be an array of integers between 0 and 255 inclusive.

Arguments:

file is either the pathname to a BMP file.

file is entered as a string.

Launch QuickSheet Example


Creating a New SmartSketch Drawing

If you choose "New SmartSketch Document" when inserting the SmartSketch component, you need to create a new SmartSketch drawing after the component appears. To do so:

  1. Double-click on the component and use SmartSketch's menus and toolbars to create a drawing. Use the Dimensions toolbar to add dimensions to your drawing.

  2. Choose Variables from the Tools menu to define variables or edit dimensions. Close the Variable Table before clicking back in the Mathcad worksheet.

  3. Next, you need to bind variables, dimensions, or symbols to the inputs or outputs. To do so, click on the component with the right mouse button and choose Properties from the pop-up menu. Use the Properties dialog to specify:

  • Input names. The dimension, symbol, or variable names used in the SmartSketch drawing that are controlled by the inputs to the smartSketch component. Choose a dimension or variable name from the drop-down list.

  • Output names. The dimension, symbol, or variable names used in the smartSketch drawing that define the output variables in Mathcad. Choose a dimension or variable name from the drop-down list.

When you click outside the component, input values are sent to the SmartSketch drawing from Mathcad and values are returned to Mathcad as output.

Notes:

  • If the drawing is so large that it extends beyond the component window, click on the component with the right mouse button, choose Properties from the pop-up menu, and click the box next to "Automatic Resizing".

  • In order for the dimensions in a drawing to resize relative to any changes to the dimensions, there should be a check next to the Maintain Relationships option under the Tools menu in SmartSketch. To verify this, double-click on the component and choose Tools from the menu bar.

  • For more information on SmartSketch, refer to the tutorials and documentation available by choosing from the Help menu in SmartSketch. Sample Mathcad files containing SmartSketch components are located in the SAMPLES\CAD folder under QuickSheets in the Help menu if you installed them from the CD.


Creating a Polar Plot

To create a polar plot,

  1. Choose Graph / Polar Plot from the Insert menu to create a polar plot region.

  2. Fill in the bottom middle placeholder with an angle variable to plot against. For example, type ‘A’ if you had previously defined ‘A’ as a range variable. (Do not define ‘A’ if you want to create a Quickplot.)

  3. Fill in the left placeholder with a radial expression to plot. For example, type 'cos(A)' to plot the cosine of the variable A.

The polar plot is created by mapping r and q onto x and y using the standard transformations:

x=r*cos( q ) and y=r*sin( q ),

where r and q can assume positive or negative values.

Notes:

  • Complex or imaginary points are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

  • You can plot more than one polar curve on a graph.


Creating a 3D Scatter Plot from a Function

Creating a Scatter Plot from a Function

To create a scatter plot of a function (called a QuickPlot):

  1. Define the function or set of functions.

  2. Choose Graph / 3D Scatter Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the function or set of functions in the placeholder. If you enter a set of function names, enclose them in parentheses.

A scatter plot of the function is created using default ranges and grids for the independent variables. To change them, double-click on the graph and use the options in the QuickPlot Data tab of the 3D Plot Format dialog box.

Launch QuickSheet Example


Creating a 3D Scatter Plot from a Matrix of Data Values

To create a 3D scatter plot using a matrix of data values:

  1. Define the matrix of values to plot.

  2. Choose Graph / 3D Scatter Plot from the Insert menu.

  3. Place the name of the matrix in the placeholder.

Launch QuickSheet Example


Creating a 3D Scatter Plot from Three Data Vectors

To create a 3D scatter plot using the x, y and z coordinates contained in three vectors:

  1. Define three vectors, each having as many elements as you have points to plot.

  2. Choose Graph / 3D Scatter Plot from the Insert menu.

  3. Type ( in the placeholder .

  4. Type the names of the vectors separated by commas.

  5. Type ) .

If a point is complex or imaginary, it is not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.


Creating a Space Curve

To create a space curve of a function of one variable (called a QuickPlot):

  1. Define the function or set of functions, see Functions for Creating a Space Curve.

  2. Choose Graph / 3D Scatter Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the function or set of functions in the placeholder. If you enter a set of function names, enclose them in parentheses.

A space curve is created using default ranges and grids for the independent variables. To change them, double-click on the graph and use the options in the QuickPlot Data tab of the 3D Plot Format dialog box.


Creating a String

To create a string:

  1. Click on a placeholder in a math expression or click on a blank space in your worksheet, and choose Math Region from the Insert menu.

  2. Press the double quotes key (“). You see an insertion line between double quotes.

  3. Type any combination of letters, numbers, or other characters.

Examples of strings:

“hello world!”

“5.67e-2” (a number string)

“-4.3 - 6.7i” (a number string)


Creating a Surface Plot

To create a surface plot of a function (called a QuickPlot):

  1. Define the function or set of functions.

  2. Choose Graph / Surface Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the function or set of functions in the placeholder. If you enter a set of function names, enclose them in parentheses.

The surface plot of the function is created using default ranges and grids for the independent variables. To change them, double-click on the graph and use the options in the QuickPlot Data tab of the 3D Plot Format dialog box.

To create a surface plot from data:

  1. Define the matrix of elements to plot. The matrix must have at least two rows and two columns.

  2. Choose Graph / Surface Plot from the Insert menu to a create a surface plot region.

  3. Place the name of the matrix in the placeholder.

A perspective view of the matrix is drawn as a two-dimensional grid lying flat in three-dimensional space. Each matrix element is represented as a point at a specified height above or below this grid.

Note:

  • Complex or imaginary point are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

  • Alternatively you can create a surface plot from a set of x, y and z data points. First create three vectors: one containing the x values, one containing the y values, and one the z values. Create a surface plot region and type the names of the x, y and z vectors separated by commas into the placeholder. The surface plot generated is the same as a 3D scatter plot changed into a surface plot.


Creating a Vector Field Plot

To create a graphical representation of a two dimensional vector field:

  1. Define a matrix containing as many elements as there are vectors to plot.

  2. Each matrix element is a two-dimensional vector represented by a complex number. The real part of that number is the x component of the vector. The imaginary part is the y component.

  3. The location of an element in a matrix maps to the location of the corresponding vector in the xy plane.

  4. Choose Graph / Vector Field Plot from the Insert menu.

  5. Place the name of the matrix in the placeholder.

Alternatively, you can use two real matrices having the same number of rows and columns. Corresponding elements of these matrices represent the x and y components of a particular vector. Enter the names of these matrices, separated by commas and enclosed in parentheses, in the placeholder.

Complex or imaginary points are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

Launch QuickSheet Example


Creating an Array using a Function

Creating Arrays

matrix(m,n,f)
 Creates a matrix in which the ijth element contains f(i,j) where i= 0,1..m-1
 and j=0,1.. n-1.

Arguments:

m is the number of rows the matrix will have.

n is the number of columns the matrix will have.

f is a function of two variables.

Launch QuickSheet Example


Creating an X-Y Plot

To create an X-Y plot:

  1. Choose Graph / X-Y Plot from the Insert menu to create a plot region.

  2. In the middle placeholder underneath the x-axis (horizontal axis), enter the variable or expression you want to plot against.

    The variable is usually a range variable that you defined previously. However, if this variable is not defined previously, the worksheet creates the graph using the values -10 to 10. This is referred to as a QuickPlot.

  3. In the middle placeholder beside the y-axis (vertical axis), enter the expression you want to plot.

  4. Click away from the plot or press [Enter]. One point is plotted for each value of the x-axis variable and, unless you specify otherwise, the worksheet connects them with straight lines.

Notes:

  • You can graph any expression against any other expression, as long as they share the same independent variables. You can also graph more than one curve on a graph.

  • Complex or imaginary points are not plotted. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

  • If a plot does not appear as smooth as you would like, try using a smaller step size in the range variable involved in creating the plot.

Launch QuickSheet Example


Creating and Editing Text

Creating text

Importing text from another application

Moving a text region

Editing text

Inserting math in text

Creating a hyperlink from text


Creating and loading colormaps

SaveColormap("file", M) Creates a colormap file containing the values in M. Returns the number of rows written to the file.

LoadColormap("file") Returns an array containing the values in the colormap file.

Arguments:

file is the name of a colormap located in the CMAPS subfolder of the Mathcad folder.

file is entered as a string.

M is a matrix having three columns whose elements are integers between 0 and 255. The values are arranged so that they are suitable for creating a colormap.

Examples:

If gbmap is a 2x3 matrix, then:

SaveColormap("grayblue", gbmap) = 2

A := LoadColormap("grayblue")

Notes:

  • After you use the SaveColormap function, the colormap is available on the Advanced tab in the 3D Plot Format dialog box.

  • LoadColormap is useful when you want to edit a colormap or use it to create a new colormap.

  • Any values in the matrix M that are not integers are truncated.

  • Any values in the matrix M that are not between 0 and 255 are increased to 0 or decreased to 255.


Creating user DLLs

Creating your own functions

You can extend Mathcad’s power by writing your own customized functions in C or C++. Customized functions can accept and return complex scalars or complex arrays. Customized functions can also have features such as error messages, interruption, and exception handling.

To create customized functions, you first need to create source code using the structures and functions provided by Mathsoft. Next, you compile the code and link it to create a DLL.

For information on the structures and functions, the steps for creating a DLL, and other details, refer to the Developer's Reference. You should also check the Mathsoft website (www.mathsoft.com) for updated information.


Cross product is defined only for vectors having three elements

Cross product is defined only for vectors having exactly three elements.

The vector cross product is defined only for vectors having three elements.


Cross product operator

Vector Cross Product

Keystroke: Ctrl+8

Returns the vector cross product of u and v.

Operands:

  • Both u and v are three element column vectors.

is a vector with the following properties:

  • Its direction is orthogonal to u and v in the direction determined by the right hand rule.

  • Its magnitude is | u || v |sin( [image]) where [image] is the angle between u and v.

Launch QuickSheet Example


Crosshair

The red 'crosshair' ('+') defines the entry point where the next character you type or the next paste from the clipboard will appear.

Position the crosshair by clicking the mouse at the cursor location wherever you want to put it. The crosshair can also be moved with the arrow keys, the Enter key, the space bar, or the PgUp and PgDn keys.


Crosshair Cursor

Where can it appear?

How do you make it appear?

How do you move it around?

What's it for?


Ctrl + Down Arrow Movement

In blank space...

Moves the crosshair down one space.

In math...

Inactive.

In text...

Moves the insertion point to the end of the current line. If it is already at the beginning, this moves the insertion point to the end of the next line. If it is already at the end of the last line, the insertion point jumps out of the text and becomes a crosshair in the empty space just below the text.


Ctrl + End Key Movement

In blank space...

Moves the crosshair beside the last region in the worksheet. If the crosshair is already at the last region, this does nothing.

In math...

Moves the editing lines to the end of the expression. If the editing lines are already there, this does nothing.

In text...

Moves the text insertion point to the end of the last line of text in the current text region. If the insertion point is already there, this does nothing.


Ctrl + Home Key Movement

In blank space...

Moves the crosshair beside the first region in the worksheet. If the crosshair is already at the last region, this does nothing.

In math...

Moves the editing lines to the beginning of the expression. If the editing lines are already there, this does nothing.

In text...

Moves the text insertion point to the beginning of the first line of text in the current text region. If the insertion point is already there, this does nothing.


Ctrl + Left Arrow Movement

In blank space...

Move crosshair one space to the left.

In math...

Moves the vertical editing line to the left of the horizontal editing line, if it isn't already.

In text...

Moves the insertion point to the beginning of the previous word. If it is already at the beginning of the text, the insertion point jumps out of the text and turns into a crosshair in the empty space to the left.


Ctrl + Right Arrow Movement

In blank space...

Move the crosshair one space to the right.

In math...

Moves the vertical editing line to the right of the horizontal editing line, if it isn't already.

In text...

Moves the insertion point to the end of the next word. If it is already at the end of the text, the insertion point jumps out of the text and turns into a crosshair in the empty space to the right.


Ctrl + Up Arrow Movement

In blank space...

Moves the crosshair up one space.

In math...

Inactive.

In text...

Moves the insertion point to the beginning of the current line. If it is already at the beginning, this moves the insertion point to the beginning of the previous line. If it is already at the beginning of the first line, the insertion point jumps out of the text and becomes a crosshair in the empty space just above the text.


Cubic Spline Interpolation

cspline(vx,vy) Returns a vector of second derivatives for data vectors vx and vy. This vector becomes the first argument of the interp function. The resultant spline curve is cubic at the endpoints.

pspline(vx,vy) Same as cspline, except that the resultant spline curve is parabolic at the endpoints.

lspline(vx,vy) Same as cspline, except that the resultant spline curve is linear at the endpoints.

interp(vs,vx,vy,x) Returns a spline interpolated value of vy at a point x.

Arguments:

  • vx is a vector of real data values in ascending order. These correspond to the x values.

  • vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

  • vs is a vector generated by either cspline, pspline or lspline.

  • x is the value of the independent variable at which you want to interpolate a result. For best results, this should be in the range encompassed by the values of vx.

Cubic spline interpolation lets you pass a curve through a set of points in such a way that the first and second derivatives of the curve are continuous across each point. This curve is assembled by taking three adjacent points and construction a cubic polynomial passing through those points. These cubic polynomials are then strung together to form the completed curve.

The example below illustrates the use of cubic spline interpolation:

Launch QuickSheet Example


Cumulative Interest

cumint(rate, nper, pv, start, end, [type]) Returns the cumulative interest paid on a loan between a starting period and an ending period given a fixed interest rate, the total number of compounding periods, and the present value of the loan.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate ³ 0.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

nper is the total number of compounding periods. nper is a positive integer.

pv is the present value of the loan. pv [image] 0.

start is the starting period of accumulation. start is a positive integer.

end is the ending period of accumulation. end is a positive integer. start [image] end.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Example:

A home mortgage loan of $150,000 has an annual interest rate of 8.3%. The loan is for 30 years. The total interest paid on the loan during the first year is:

cumint(.006917,360,150000,1,12) = 12406.37


Cumulative Principal

cumprn(rate, nper, pv, start, end, [type]) Returns the cumulative principal paid on a loan between a starting period and an ending period given a fixed interest rate, the total number of compounding periods, and the present value of the loan.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate ³ 0.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

nper is the total number of compounding periods. nper is a positive integer.

pv is the present value of the loan. pv [image] 0.

start is the starting period of accumulation. start is a positive integer.

end is the ending period of accumulation. end is a positive integer. start [image] end.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.


Cumulative Probability Distribution

These give the probability that a random variable will take on a value less than or equal to a specified value. These are obtained by simply integrating (or summing when appropriate) the corresponding probability density over an appropriate range.


Current working directory

Cwd default = a directory string

This string variable displays the current working directory Mathcad is using. The working directory is the directory into which files are saved and the directory in which Mathcad looks for data files.

By default, the value of CWD is the directory into which you installed Mathcad (usually c:\Program Files\Mathsoft\Mathcad). To change the default value of CWD:

Create a Mathcad icon on the desktop of your operating system if you do not have one already.

Set the working directory or the “start in” directory to whatever you would like Mathcad to default to using.


Customize Toolbar dialog box

Customize Toolbar Dialog

The Customize Toolbar dialog has the following options:

Available toolbar buttons

Displays the buttons that you can add to the toolbar.

Current toolbar buttons

Displays the buttons in the order they appear (from left to right) on the toolbar in the active window.

Add

Moves the button selected in the Available Buttons list to the Toolbar Buttons list. Another way to move the button is to drag it from the Available Buttons list to the Toolbar Buttons list.

Remove

Moves the button selected in the Toolbar Buttons list to the Available Buttons list. Another way to move the button is to drag it from the Available Buttons list to the Toolbar Buttons list.

Move up

Moves the selected button one up line. On the toolbar, the button shifts left one space. Another way to move the button is to drag it up.

Move down

Moves the selected button down one line. On the toolbar, the button shifts right one space. Another way to move the button is to drag it up.

Reset

Restores the set of buttons as they were when the dialog box was opened.


Customizing a Toolbar

You can change the buttons that appear on the Standard toolbar and the Formatting toolbar.

To add, subtract, or reorder buttons on these toolbars:

  1. Right click on the toolbar.

  2. Choose Customize from the pop-up menu to open the Customize Toolbar dialog box.

  3. Click on the button from the list of "Available buttons."

  4. Click "Add" or drag the button to the "Toolbar buttons" section of the dialog box.

To remove a button from the toolbar:

  1. Click on the toolbar with the right mouse button.

  2. Choose Customize from the pop-up menu to open the Customize Toolbar dialog box.

  3. Click on the button from the list of "Toolbar buttons."

  4. Click "Remove" or drag the button to the "Available buttons" section of the dialog box.

To rearrange the buttons on a toolbar using the Customize Toolbar dialog box:

  1. Click on a button.

  2. Click "Move Up" or "Move Down" or drag the button up or down.

Notes

  • To hide or view a toolbar, choose Toolbars from the View menu.

  • To quickly remove a button from a toolbar, press the Alt key and drag the button off the worksheet window until it disappears.

  • To quickly move a button from one toolbar to another, press the Alt key and drag it to another toolbar.

  • To quickly hide a visible toolbar, right-click on a visible toolbar and choose Hide from the pop-up menu.


cyl2xyz built-in function

cyl2xyz is a built-in function that converts circular cylindrical coordinates to Cartesian coordinates. For example:

You can use cyl2xyz as the fmap argument to CreateMesh or CreateSpace.


Data Exchange

Data passes from the input variable into the component, and the output variable will become defined with the output.


Data File Column Width

Print Column Width

PRNCOLWIDTH (Default = 8)

This represents the width of columns in ASCII files created by the WRITEPRN function.

To change it, choose Worksheet Options from the Tools menu and click the Built-in Variables tab.


Databases and SQL Support

The ODBC component requires that the database from which information is retrieved supports SQL in its ODBC driver such as Microsoft Access or FoxPro. There are some programs that have SQL support within their applications, but do not support SQL in their ODBC drivers, such as Microsoft Excel.


DataValue Objects

  • The Value property accesses a DataValue’s real part. For example, in VBScript or JScript Inputs(0).Value returns the real part of the first input.

  • The IValue property accesses a DataValue’s imaginary part. For example, in VBScript or JScript Outputs(1).IValue returns the imaginary part of the second output. If there is no imaginary part, the IValue portion returns “NIL.”

  • The IsComplex property returns “TRUE” if a DataValue has a valid imaginary part; this property returns “FALSE” otherwise. For example, the expression (inputs(0).IsComplex) returns “FALSE” if the first input has only a real part.

  • The Rows and Cols properties yield the number of rows and columns.

Note: In JScript, the names of functions, methods, objects, and properties are case sensitive, while in VBScript they are not.


Default Axes Page for Polar Plots

The Setting Default Formats for Polar Plots dialog box has the following options on the Polar Axes tab:

Log Scale

Makes the radial axis logarithmic. The axis limits must be positive.

Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by gridlines.

Numbered

When this box is checked, the tick marks on the selected axis are numbered.

Show Markers

Lets you add radial reference lines to a plot. To do so:

  • Click on the "Show Markers" checkbox in the Radial Axis column. You'll see two additional placeholders on the upper-left side of the plot.

  • Click on one of the placeholders and type in the value at which you want a line drawn. Repeat this process on the other placeholder to add the second radial reference line.

Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

Number of Grids

When Auto Grid is not checked, enter an integer from 2 to 99 to indicate the number of grid lines to draw. Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.

Axis Style - Perimeter, Crossed, None

Controls whether the axes intersect in the center of the plot (crossed), whether they enclose the plot in a circle (perimeter), or whether they appear at all.


Default Radial Axis Limits

For a linear scale:

  • The upper limit is set to the maximum radial value of the function plotted.

  • The lower limit on a linear scale is zero.

For a logarithmic scale:

  • The upper limit is set to the next higher integer power of ten above the maximum of the data.

  • The lower limit is set to the next integer power of ten below the minimum of the data.


Default Settings (Polar Plots)

Default Settings for Polar Plots

To reset a plot to the default settings:

  1. Double-click on the plot to open a tabbed dialog box.

  2. If necessary, click on the Defaults tab.

  3. Click on the "Change to Defaults" button.

To make the default settings be those of a particular plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. If necessary, click on the Defaults tab.

  3. Click on the "Use for Defaults" check box.

To set defaults without using a graph:

  1. Make sure that you don't have any graphs selected.

  2. Choose Graph Þ Polar Plot from the Format menu to invoke the Setting Default Formats of Polar Plots dialog.

  3. Change the appropriate settings on the Polar Axes and Traces pages.

  4. Click "OK" to accept your changes and close the dialog box.


Default Settings (X-Y Plots)

To reset a plot to the default settings:

  1. Double-click on the plot to open a tabbed dialog box.

  2. If necessary, click on the Defaults tab.

  3. Click on the "Change to Defaults" button.

To make the default settings be those of a particular plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. If necessary, click on the Defaults tab.

  3. Click on the "Use for Defaults" check box.

To set defaults without using a graph:

  1. Make sure that you don't have any graphs selected.

  2. Choose Graph Þ X-Y Plot from the Format menu to open the tabbed dialog box.

  3. Change the appropriate settings on the X-Y Axes and Traces pages.

  4. Click "OK" to accept your changes and close the dialog box.


Defaults Page for Polar Plots

The Formatting Currently Selected Polar Plot dialog box has the following options on the Defaults tab:

Change to Defaults

Changes all the settings in the dialog box to the default settings for the worksheet.

Use for Defaults

When this is checked, the settings in the dialog box are used as the default settings for any new polar plots you create. Existing polar plots do not change.


Defaults Page for XY Plots

The Formatting Currently Selected X-Y Plot dialog box has the following options on the Defaults tab:

Change to Defaults

Changes all the settings in the dialog box to the default settings for the worksheet.

Use for Defaults

When this is checked, the settings in the dialog box are used as the default settings for any new plots you create. Existing plots do not change.


Defining a Custom Binary Operator

If an operator isn't one of the built-in operators, you can define your own the same way you would define a function. To define a binary operator:

  1. Type the name of the operator.

  2. Type a "(" followed by the operands separated by comma, and a ")"

  3. Type a ":"

  4. In the placeholder, type an expression involving the operands.

Launch QuickSheet Example


Defining a Custom Unary Operator

If an operator isn't one of the built-in operators, you can define your own the same way you would define a function. To define a unary operator:

Type the name of the operator

Type a "(" followed by the operand and a ")"

Type a ":"

In the placeholder, type an expression involving the operand

Launch QuickSheet Example


Defining a Program

To following steps illustrate how to define a sample program:

  1. Type the left side of a function definition followed by the assignment operator ":"

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click the "Add Line" button or press ]. This creates a vertical bar with a placeholder for an additional program statement (a program can have any number of statements).

  4. Click on the top placeholder, type "z" and click on the local assignment button. (Be aware that the definition of z is local to the program. It is undefined outside the program and has no effect anywhere but inside the program.)

  5. Complete the local assignment by typing "x/w" in the placeholder to the right of the arrow.

  6. The last placeholder should always contain the value returned by the program. Type "log(z)" into this placeholder.

You can now use this function just as you would any other function or evaluate it symbolically.

Launch QuickSheet Example


Defining a Range - Step 1


Defining a Range - Step 2


Defining a Range - Step 3


Defining a Range - Step 4


Defining a Range - Step 5


Defining a Range - Step 6


Defining a Range Variable

A range variable is a variable that takes on a sequence of values. To define a range variable:

Type the name of the variable followed by ":" (colon).

In the placeholder, type the first number in the sequence of values.

Type a comma. (Or, if you're defining a sequence that goes up or down in steps of one, you can skip this step and the next one.)

Type the second number in the sequence.

Type a ";" (semicolon). Note that it appears as two dots ".."

In the remaining placeholder, type the last number in the sequence.

Launch QuickSheet Example


Defining Array Elements

To define individual array elements, use subscripts. For example, type:

v[3:6

to define the fourth element of the vector v.

When you define array elements, you may leave gaps in the vector. For example, if v is undefined and you define the third element, the first and second elements are undefined. Undefined elements are filled with zeros. Be careful of inadvertently creating large arrays by defining elements individually.


Definition Symbol

:=

This is the most commonly used assignment operator. It evaluates whatever is on its right and assigns it to the variable name on its left.

The left side must be either a variable name or a function name; not an expression. The right side must be an expression that evaluates to a number or a function definition. Any variables or functions on the right side must already have been defined.


Degree of the polynomial must be between 1 and 99.

The vector passed to the polyroots function must have at least two elements and no more than ninety-nine.


Deleting a Blank Line

To delete a blank line...

  1. Click in a blank space above the line you want to delete.

  2. Press Delete as many times as there are blank lines to delete.

You can also delete a specific number of lines by clicking in a blank space and then right-clicking to get a pop-up dialog.

Choose Delete Lines then enter the number of lines to delete.


Deleting a Collapsed Area

Once you’ve collapsed an area, you may delete the collapsed area bar just as you would any other region. To do so:

  1. Click on the collapsed area bar.

  2. Press Ctrl D or choose Delete from the Edit menu.


Deleting a Lockable Area

Once you’ve unlocked an area, you may delete it just as you would any other region. To do so:

  1. Select either of the area boundaries.

  2. Choose Cut from the Edit menu.


Deleting a Negative (a+b)


Deleting Columns

To delete one or more columns in a matrix:

  1. Click on an element in the column to remove or in the column to the left of which you want to remove columns.

  2. Choose Matrix from the Insert menu to bring up a dialog box.

  3. Specify the number of columns to delete.

  4. Click the "Delete" button.

This procedure deletes the column containing the selected element and the appropriate number of columns to the right.


Deleting Regions

To delete one or more regions:

  1. Select the regions you want to delete.

  2. Choose Cut or Delete from the Edit menu.


Deleting Rows

To delete one or more rows in a vector or matrix:

  1. Click on an element in the first row you want to delete.

  2. Choose Matrix from the Insert menu to bring up a dialog box.

  3. Specify the number of rows to delete.

  4. Click the "Delete" button.

This procedure deletes the row containing the selected element together with an appropriate number of rows below it.


Derivates of Order Greater than 5

Although the derivative operator won't compute derivatives of order greater than 5, you can nest derivative operators within each other to compute higher order derivatives.


Designating an Area to Lock or Collapse

To designate an area to lock or collapse:

1. Click in a blank space near the area you want to lock. You should see the crosshair.

2. Choose Area from the Insert menu. Two area boundaries appear:

3. Select and drag these boundaries if necessary to make the area larger or smaller.

4. Between the boundaries, create the regions you want to lock, or move the regions from elsewhere in your worksheet.

After inserting an area, you can lock the area and/or collapse it to hide the regions inside.

Notes:

  • You can have any number of areas in your worksheet, but you cannot have one area inside another.

  • You can change the appearance of the area boundaries.


Determinant Operator

Keystroke: |

| M |

Returns the determinant of a square matrix.

Operands:

  • M is a square matrix.

To take the magnitude of each element in a matrix,

  • Place the | M | between the editing lines.

  • Apply the vectorize operator, Ctrl+-.

Although you can use the determinant operator to find numerical determinants, you can also find symbolic determinants.


Diagonal Matrix Function

diag(v) Returns a diagonal matrix containing on its diagonal the elements of v.

Arguments:

v must be a vector.

Launch QuickSheet Example


Excel Component Properties: Inputs

Use the Inputs tab of the Excel Properties dialog box to specify the cells in the Excel component which the each input will be stored. If the input is a single value, enter the cell in which it will be stored. If an input consists of more than one value, enter the starting cell for them.

Each input variable will send values from Mathcad to the cells in an Excel worksheet. Enter any valid Excel cell range. For example, enter C2:L11 to indicated the cells C2 through L11. You can also enter named cells.

To specify a particular Excel worksheet and cell range, enter worksheet name and an exclamation point before the cell range. For example, enter Sheet2!B2:C2.


Excel Component Properties: Outputs

Use the Outputs tab of the Excel Properties dialog box to specify the cells in the Excel component from which each output will be extracted. For example, if you want the first output to be the values in cells A1, A2, B1, and B2 you should enter A1:B2. You can also enter named cells.

To specify a particular Excel worksheet and cell range, enter worksheet name and an exclamation point before the cell range. For example, enter Sheet2!B2:C2.


Data File Input and Data File Output: Options

File Input and File Output: Options Tab

Select File Input or File Output from Data on the Insert menu. The Options tab of the File Input or File Output component’s Properties dialog box allows you to read in only certain rows or columns of a data file. You can leave out label and title rows when reading in data.:

  1. Start at Row: Type in the number of the row containing the first value to read.

  2. Start at Column: Type in the column number containing the first value to read.

By default, Stop at End of Data is turned ON for both rows and columns. This option makes the File Input and File Output components read all the values from the starting value to the end of the file. Alternatively, click Stop at End of Data to turn it OFF and enter a value in the Stop at Row box and/or the Stop at Column box.


MATLAB component properties: Inputs

Matlab component properties: input variables

Use the Inputs tab of the MATLAB Properties dialog box to specify names for the input variables for the MATLAB component.


MATLAB component properties: Outputs

Matlab component properties: output variables

Use the Outputs tab of the MATLAB Properties dialog box to specify names for the output variables for the MATLAB component.


Paragraph Format Dialog Box

The Paragraph Format dialog box contains the following:

Indent - Left, Right

Sets the indentation amount measured (according to the units chosen in your operating system) from the left or right side of the text region.

Special

Allows you to indent in a specified way.

  • Choose First Line to make only the first line in the selected paragraph indented. Specify the amount of indentation in the By box.

  • Choose Hanging to make all lines except the first line indented. Specify the amount of indentation in the By box.

By

Allows you to specify the amount of indentation (according to the units chosen in your operating system), measured from the left edge of the paragraph, for indentations selected in the Special box.

Tabs

Brings up the Tabs dialog box, which allows you to set tab stops.

Bullets

Provides a list of symbols with which to begin the selected paragraph(s).

  • Choose Bullets to use round, black dots.

  • Choose Numbered to use consecutive numbers (1, 2, 3, etc.).

Alignment - Left, Right, Center

Makes the text in the selected paragraph(s) left-aligned, right-aligned, or centered within the text region.


S-plus Component Properties: Graph Type

Use the options in the Graph Type page to specify the kind of graph to create using the S-PLUS Graph component. Choose to create a Line Plot, a Gui Graph, or a traditional S-PLUS graph based on commands (Graph Script).

Gui Graph

Select this button to create an S-PLUS GUI graph in your Mathcad worksheet.

Axis Type

Shows the current S-PLUS axis type.

Plot Type

Shows the current S-PLUS plot type.

Choose Axis/Plot Type

Brings up the Choose Graph and Plot Type dialog, which has scrolled lists from which you can select the axis type and the plot type, for example Log Y Line with Scatter.

Call Graph Script

Select this radio button to create an S-PLUS graph using “traditional” command-line graphics functions. To enter commands, open the Script Editor by choosing Edit Script from the component’s shortcut menu. The script you enter can contain any S-PLUS code, with calls to plot, points, etc. to generate one or more graphs.


S-plus component properties: input variables

Use the Input Variables tab of the S-PLUS Properties dialog box to specify names for the output variables for the S-PLUS Graph component or the S-PLUS Script component.

Variable

(read-only) Identifies the input variables from 1 to 4.

Assigned Name

Enter the name you want for each input variable. The defaults are in0, in1, in2, in3.

Defaults

Click to reset all Assigned Names to their default values.

Check input variables to use as conditioning variables in Gui Graphs: Check each input variable which is to provide conditioning variables to the graph.

Static Variable Names

Add static variable names, separated by commas. Static variables used in the S-PLUS Script component are those which keep their values between calls to the script. All static variables are reset whenever the script itself is changed.


S-plus component properties: output variables

Use the Output Variables tab of the S-PLUS Properties dialog box to specify names for the output variables for the S-PLUS Graph component or the S-PLUS Script component.

Variable

(read-only) Identifies the output variables from 1 to 4.

Assigned Name

Enter the name you want for each output variable. The defaults are out0, out1, out2, out3.

Defaults

Click to reset all Assigned Names to their default values.


The Jacobian Matrix


Difference Equations

You can use range variables in conjunction with arrays to evaluate a difference equation. The following example shows how to fill an array with Fibonacci numbers.

Launch QuickSheet Example


Differential Equation Solvers

There are a variety of Mathcad functions for numerically solving ordinary differential equations (ODE), partial differential equations (PDE), and systems of ODEs/PDEs. ODE solvers solve for unknown functions of one variable, and PDE solvers solve for functions of two variables (so-called 1-D PDEs). The Odesolve and Pdesolve functions are used within solve blocks, allowing for natural notation, and are the easiest to use and interpret. The command line functions can be used within programs for iterative calculations.

Solving ordinary differential equations

Odesolve(x,b,step)

rkfixed(y,x1,x2,npoints,D)

Specialized ODE command-line solvers

Bulstoer(y,x1,x2,npoints,D): extra accuracy for smoothly varying systems

Radau(y,x1,x2,npoints,D), Stiffb(y,x1,x2,npoints,D,J), or Stiffr(y,x1,x2,npoints,D,J): extra accuracy for stiff systems

Rkadapt(y,x1,x2,npoints,D): faster and more accurate for systems with both slowly-varying and rapidly-varying intervals

For each of these solvers, using a lowercase function name instead of the uppercase will solve for only the last point on the integration interval, which can save processing time and reduce memory consumption. Unlike their uppercase equivalents, you don't specify the number of points in the result. Instead, you specify the level of accuracy and allow these functions to generate a solution having the required number of elements.

Two-point boundary value problem solvers

bvalfit(v1,v2,x1,x2,xf,D,load1,load2,score)

sbval(v,x1,x2,D,load,score)

Partial differential equations

Mathcad includes functions for numerically solving several types of partial differential equations (PDEs), and systems of PDEs. PDE solvers solve for unknown functions of two variables (so-called 1-D PDEs). The Pdesolve function is used within a solve block, allowing for natural notation, and is the easiest to use and interpret. The command line functions can be used within programs for iterative calculations.

Pdesolve(u, x, xrange, t, trange, xpts, tpts): solve block solver for hyperbolic and parabolic systems of 1-D PDEs, including coupled ODEs and algebraic constraints

numol(x_endpts, xpts, t_endpts, tpts, num_pde, num_pae, pde_func, pinit, bc_func): command-line solver for hyperbolic and parabolic systems of 1-D PDEs

relax(a,b,c,d,e,f,u,rjac): command-line solver for Poisson's/Laplace's elliptic PDE

multigrid(M,ncycle): : command-line solver for Poisson's/Laplace's elliptic PDE, with zero (or constant) boundary conditions


Differential Equations with Special Properties

Follow the example for using rkfixed for one or more differential equations but use one of the functions below in place of rkfixed.

  • For smooth systems, use Bulstoer.

  • For stiff systems, use Radau, Stiffb or Stiffr.

  • For slowly-varying systems, use Rkadapt.


Differentiation operator

Derivative

Keystroke: ?

Returns the derivative of f(t) evaluated at the point t.

Operands:

f(t) is a scalar valued function.

t is the point at which the derivative is to be evaluated.

You must first define the point at which the derivative is to be evaluated. For example:

Notes:

  • In the above example that the value returned is the derivative of f with respect to t evaluated at whatever point(s) t is defined at.

  • Although the example shows a function of one variable, f can be a function of any number of variables.

  • If f has several terms, be sure to enclose them in parentheses to keep them inside the derivative operator.

  • With Mathcad’s derivative algorithm, you can expect the first derivative to be accurate to within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.

  • You can change the display of this operator to a partial derivative symbol if you want to.

Launch QuickSheet Example


Diffuse Light

Diffuse light comes from a particular direction but is reflected off a surface evenly in different directions. A diffuse light brightens an object. Florescent lighting is a good example.

Ambient and diffuse light have the greatest effect in determining color of a plot.


Digamma Function


Dilogarithm Function


Dimensions

A dimension is a physical quantity associated with a number, an array or a variable representing a number or array. You can combine any of the following fundamental dimensions:

length,

time,

mass,

charge,

temperature.

Note that a dimension is not a unit. A unit is a way to measure a dimension. For example, "ft", "cm" and "mm" are three different ways to measure the single dimension "length".


Dimensions of a Matrix

rows(A) Returns the number of rows in A.

cols(A) Returns the number of columns in A.

Arguments:

  • A can be a vector or a matrix.

If A is neither a vector or a matrix, both rows and cols will return zero.


Dirac Delta (Unit Impulse) Function

The Dirac Delta function is returned from Maple as D(x), where

  • D(0) = 1, and
  • D(x) = 0 everywhere else.
The integral of the Dirac Delta from -infinity to infinity is 1.


Directed Light

A directed light is aimed from a particular source and shines in a particular direction. One way to think about directed light is to picture a flashlight being held towards the plot from a certain location. A directed light consists of diffuse light and specular light.


Disabling Equations

Turning Equations On or Off

To prevent a region such as an equation or a graph from being calculated:

  1. Click in the equation.

  2. Choose Properties from the Format menu and click on the Calculation tab.

  3. Click in the box next to “Disable Evaluation.”

  4. Click “OK.”

You'll see a small box next to the equation to show that it's turned off. For example:

To turn the equation back on, follow the same steps.

Notes:

  • You can edit a disabled equation just as you would any other equation. However, a disabled equation does not affect any other calculations, nor does it reflect changes you make to other equations in the worksheet.

  • If you move a disabled equation that happens to be displaying a result, the result disappears. If you move a disabled graph, whatever is inside the graph disappears.


Disadvantages of Automatic Mode

If your worksheet contains lots of computationally intensive equations, you may find scrolling through the worksheet time-consuming.


Disadvantages of Manual Mode

Results in your worksheet may not be up-to-date. If they're not, you'll see the word "calc" on the message line.


Discarding Large Result

The answer is too large to display as a formatted math region. You can place the answer in the clipboard.


Discontinuous or conditional functions

if(cond, tval, fval)

Returns tval if cond is true, otherwise returns fval.

(m, n)

Kronecker delta. Returns 1 if m=n and 0 otherwise.

sign(x)

Sign of a number. Returns 0 if x=0, 1 if x>0, and -1 otherwise.

(i,j,k)

Completely antisymmetric tensor function.

(x)

Heaviside step function. Returns 0 when x<0 and 1 otherwise.


Discrete Transform Functions

fft(v) and FFT(v)

Return the Fast Fourier Transform of real valued data in vector v. The lowercase fft function is normalized by 1/sqrt(n) and the uppercase FFT function is normalized by 1/n. These functions assume vectors of length 2m.

ifft(u) and IFFT(u)

Return the inverse Fast Fourier Transform assuming a vector u of length 1+2m-1. Returns v if u=fft(v). The lowercase ifft function is normalized by 1/sqrt(n) and the uppercase IFFT function is normalized by 1/n. These functions assume vectors of length 2m.

cfft(A) and CFFT(A)

Return the Discrete Fourier Transform of real or complex valued data in vector or array A of arbitrary size. If A is an array, returns the 2-D Fourier transform. The lowercase cfft function is normalized by 1/sqrt(n) and the uppercase CFFT function is normalized by 1/n. These functions assume vectors of length 2m.

icfft(B) and ICFFT(B)

Return the inverse Discrete Fourier Transform for array of arbitrary size. Returns A if B=cfft(A). The lowercase icfft function is normalized by 1/sqrt(n) and the uppercase ICFFT function is normalized by 1/n. These functions assume vectors of length 2m.

wave(v)

Discrete wavelet transform of real-valued data in vector v.

iwave(u)

Inverse of wave. Returns v if u=wave(v).


Display Options for a 3D Plot

Once you create a 3D plot, you can display it as another type of 3D plot without recreating the plot. To do so:

  1. Double-click on the graph to open a tabbed dialog box.

  2. Click on the General tab to open the General page.

  3. Use the options in the Display As section to change any 3D plot (except for parametric surface plots and vector field plots) into another type of 3D plot.

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Displaying a Nested Array

When you display a nested array using the equal sign, you won't actually see every element in every nested array. Such a display would be very cumbersome, especially when you consider that an array inside an array may itself contain arrays within it.

Instead, you'll see:

  • A number when the array element is a scalar.

  • An ordered pair "{m,n}" when the array element is an m x n array.

The following example illustrates this:

In the example above, the array is displayed in matrix form. To see the full array represented by the notation, double-click on the array to bring up the Result Format dialog box and click the box next to "Expand nested arrays."

If you display the array in an output table instead, you see this same notation inside a cell the table. To temporarily see the full array represented by the notation in a cell in an output table, double-click on the cell containing the notation. For example:

Launch QuickSheet Example


Displaying a Grayscale Image

If you used READBMP or a related function to create a matrix containing a grayscale image, you display it using these steps:

  1. Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

  2. Type the name of the matrix into the placeholder.

You see a 256-shade grayscale representation of the data in the matrix, with each matrix element corresponding to a pixel in the picture.


Displaying a Color Image

If you used READRGB or a related function to create a matrix containing the color image, display it using these steps:

  1. Separate the matrix into its RED, GREEN and BLUE components as shown in the example below:

    You have defined three matrices of the same size that describe, respectively, either the red, green, and blue (RGB) components, the hue, saturation, and value (Smith’s HSV color model) components, or the hue, lightness, and saturation (Otswald’s HLS color model) components of each pixel in the picture.

  2. Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

  3. Type the names of the three matrices, separated by commas, in the placeholder at the bottom of the picture region. Or, if you want to display only the red components, for example, you must still include the three matrices but the green and blue matrices should contain zeros.

By default, Mathcad creates a 3-layer, 256-color, or RGB, representation of the data in the matrices.

If later you want to recombine the three submatrices, create and use the following function based on the augment function: augment(X,Y,Z):=augment(X,augment(Y,Z))

Note:

The picture region assumes a 256-color model with the value 0 represented as black and 255 as white. Numbers outside the range 0–255 are reduced modulo 256, and any noninteger value is treated as if its decimal part has been removed.


Displaying Symbolic Results

Symbolic display format

Large answers

Numerical results with symbolics

Special functions

Error messages in symbolics


Displaying the Image

There are two options for displaying an image. The one you choose depends on whether you read the image into a matrix using READBMP or READRGB:

  • If you used READBMP or a related function to create the grayscale image matrix...

  • If you used READRGB or a related function to create the color image matrix...


Division operator

Division

Keystroke: /

This returns y divided by x. If x=0, this returns an error message indicating there is a singularity If y is an array, the division operator divides each element by x.

Operands:

x and y are scalars.

x cannot be 0.

Note that the indeterminate form 0/0 always yields 0.


Double-headed Arrow Pointer

When the pointer looks like any one of these double-headed arrows, it means you can change the size or shape of whatever region you've selected. To get this pointer:

  • Select a region.

  • Move the pointer to one of the three "handles" lying along the edge of the region.

If you now drag the mouse you'll see the selected region change size.


Down Arrow Movement

In blank space

Moves the crosshair down one space. If another region lies immediately below, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math

Moves the editing lines down. If they are already at the bottom of the expression, they jump out of the math expression and into the blank space below it.

In text

Moves the text insertion point to the next line. If it is already on the last line, the insertion point jumps out of the text and into blank space.

Nudging regions

Moves the selected region(s) one space to the right or if held down, moves more quickly to the right.


Dragging Regions

Once you've selected one or more regions, you can drag them to another part of your worksheet. To do so:

  1. Move the mouse pointer into one of the regions enclosed by a dashed selection rectangle. The pointer turns from an arrow into a small hand.

  2. Press and hold down the mouse button.

  3. With the mouse button still held down, move the mouse pointer. Outlines of all selected regions will follow your movements.

  4. When the outlines are on the desired spots, let go of the mouse button.

If you want two regions to overlap, you can just drag one region on top of another. If necessary, you can manipulate the overlapping regions.


Dragging Regions to Another Worksheet

When dragging regions to another worksheet, drag them decisively. If you linger near the window frame the window may start to scroll instead.


Dragging the Mouse

To drag the mouse:

  1. Press and hold down the left mouse button.

  2. Without letting go of the mouse button, move the mouse.


e (natural log base)

Natural log base

Keystroke: e

Description: The value of e to 15 decimal digits when used in numerical calculations.

The exact value of e when used in symbolics calculations.


Tools - Spelling

Checks the spelling of selected text. If no text is selected, this checks spelling of all text in current text region. If a misspelled word is found, the Check Spelling dialog box appears with suggestions for the correct spelling.

Note that this checks spelling only of text. It does not check spelling in equations.


Edit - Copy

Copies whatever has been selected to the clipboard. To paste it, choose Paste from the Edit menu.


Edit - Cut

Deletes whatever has been selected and places it on the clipboard.

Note that only the most recently cut selection is on the clipboard.


Edit - Delete

Deletes whatever has been selected but does not place it in the clipboard.


Edit - Find

Brings up the Find dialog box which prompts you for a letter, number, or another supported character. You can use this command to search for characters in both text and in variable and function names. However, certain characters (such as a comma) are only locatable inside text or strings.


Edit - Go to Page

Jumps to a particular page. This command puts the top of the page you jump to at the top of your window.


Edit - Links

Edits OLE links in the worksheet. Links are created by choosing Paste Special from the Edit menu. If there are no linked objects in the worksheet, this option is not available.


Edit - Object

Allows you to edit or open an OLE object inserted into a worksheet. Click once on the object to make this menu item available.


Edit - Paste

Places whatever is in the clipboard into the worksheet. Mathcad will attempt to paste the contents the format which best suits the type of information.

  1. If you cut and paste Mathcad regions, they will remain Mathcad regions.
  2. If the contents come from another Windows application and are pasted in a blank area of the worksheet, they will be pasted as an OLE object.
  3. If you paste an array of numbers or strings into an equation placeholder, they will paste as a matrix.
  4. If you paste text from another application into a text region, it will paste as plain text.

If you are dissatisfied with the way an object pastes into Mathcad, try Edit/Paste Special... instead.

This operation does not change the contents of the clipboard.


Edit - Paste Special

Brings up the Paste Special dialog box for placing whatever is on the clipboard into the worksheet in a specified format. For example, to paste a picture taken from an OLE server as a bitmap rather than as an embedded or linked object, choose Paste Special and select "bitmap" from the Paste Special dialog box.


Edit - Redo

Undoes your most recent undo actions. The number of actions you can undo can be set in the Preferences dialog; the default is 100.


Edit - Replace

Brings up the Replace dialog box which prompts you for two sets of letters, numbers, or other supported characters. Enter the string or group of characters you want to find in the text box labeled “Find what” Enter the string you want to replace it with in the text box labeled “Replace with” You now have three choices:

  • “Find Next” - finds and selects the next instance of your target string.

  • “Replace” - replaces the currently selected instance of the string.

  • “Replace All” - replaces this instance and finds the next one.


Edit - Select All

Selects regions depending on where the cursor is located:

  • Encloses all regions in dashed rectangles if the cursor is in a blank spot on your worksheet.

  • Selects all text in a text region if the cursor is in a text region.

  • Highlights a region if the cursor is in an expression or another math region.

After one or more regions are selected, you can copy, cut, or delete them.


Edit - Undo

Undoes your most recent edit commands or keystrokes. The default length of your undo history is 100 actions, which may be changed in the Preferences dialog.


Edit Menu Commands

Undo

Redo

Cut

Copy

Paste

Paste Special...

Delete

Select All

Find...

Replace...

Go to Page...

Links...

Object


Editing an Expression - Example 1

Review the information below to see what happens to the expression above when you press a particular button.

Pressing Delete deletes whatever is immediately to the right of the insertion line. In this case, it deletes the exponent operator.

Pressing BkSp deletes whatever is immediately to the left of the insertion line, in this case, the variable "b." The black rectangle is a placeholder to show you where to type something to make exponentiation work correctly.

Pressing Space lengthens the editing lines so that more of the expression fits between them.

When you press the right arrow, the insertion line moves to whatever is to the right.

When you press the left arrow, the insertion line moves to the left.

Pressing the up arrow makes the editing lines go up.

The down arrow moves the editing lines down. Since the editing lines can't go down any further, they leave the expression altogether and turn into a crosshair just below the expression.

The general rule is that whatever is between the editing lines becomes the first operator you type.

In this example, the operator you typed is "plus". The editing lines held the "b." That's why the "b" became the first operand of the "plus".

The general rule is that whatever is between the editing lines becomes the operator you type.

In this example, the operator is "square root" and the editing lines held the "b." That's why the "b" went inside the square root.

Pressing the Insert key moves the insertion line all the way to the other side. The Insert key toggles the insertion line from one side to the other.


Editing an Expression - Example 2

Review the information below to see what happens to the expression above when you press a particular button.

Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.

BkSp will generally delete whatever is to the left of the insertion line. When the expression to be deleted is something more complicated than a name or number however, pressing BkSp highlights it as shown. Pressing BkSp again will then delete it. This makes it harder to accidentally delete an expression.

Pressing Space lengthens the editing lines so that they now enclose the entire denominator.

Since the "c" is just to the left of the insertion line, pressing the left arrow makes the editing lines select just the "c".

Since there is nothing to the right of the insertion line, pressing the right arrow makes the editing lines leave the expression altogether. The editing lines turn into a crosshair to the right of the expression.

Pressing the up arrow makes the editing lines go up.

The down arrow moves the editing lines down. Since the editing lines can't go down any further, they just leave the expression and turn into a crosshair just below the expression

The general rule is that whatever is between the editing lines becomes the first operator you type.

In this example, the operator is "plus" and the insertion point held the entire expression "b to the c" That's why the entire expression "b to the c" became the first operand of the "plus".

The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operator you type.

In this example, the operator is "square root" and the insertion point held.

The Insert key moves the insertion line to the other side. This key toggles the insertion line from one side to the other.


Editing an Expression - Example 3

Review the information below to see what happens to the expression above when you press a particular button.

Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.

BkSp will deletes whatever is to the left of the insertion line.

Pressing Space lengthens the editing lines so that they now enclose the next larger expression, in this case, "b to the c."

The right arrow moves the insertion line right. Since there is nothing to the right, of the insertion point, pressing the right arrow makes the insertion point leave the expression altogether. The insertion point turns into a crosshair to the right of the expression.

When the insertion point is in a variable name, pressing the left arrow moves it one character to the left.

Pressing the up arrow makes the insertion point go up.

Pressing the down arrow makes the insertion point go down. Since the insertion point is up in the exponent, "down" means down away from the exponent and around the "b".

The general rule is that whatever is between the editing lines becomes the first operator you type.

In this example, the operator is "plus" and the insertion point held just the c. That's why the c becomes the first operand of the plus. Note the placeholder waiting for you to supply the second operand of the plus.

The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operator you type.

In this example, the operator is "square root" and the insertion point held.

The Insert key moves the insertion line to the other side. The Insert key toggles the insertion line from one side to the other. Note that since the variable name is only one character long, this ends up having the same effect as the left arrow.


Editing an Expression - Example 4

Review the information below to see what happens to the expression above when you press a particular button.

Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.

Pressing the BkSp key usually deletes whatever is to the left of the insertion line. When the expression to be deleted is something more complicated than a name or a number, however, pressing BkSp highlights it as shown. Pressing BkSp again deletes it. This makes it harder to accidentally delete an expression.

Pressing Space lengthens the editing lines so that they now enclose the next larger expression. Since the editing lines already enclose the entire denominator, the next larger expression has to be the whole fraction.

Since there is nothing to the right, of the insertion point, pressing the right arrow makes the insertion point leave the expression altogether. The insertion point turns into a crosshair to the right of the expression.

The left arrow moves the insertion line one character to the left. The character immediately to the left is the "c," hence the insertion point now encloses the "c."

Pressing the up arrow makes the insertion point go up.

Pressing the down arrow makes the insertion point go down. Since the insertion point is as far down as it can go, it turns into a crosshair just below the expression.

The general rule is that whatever is between the editing lines becomes the first operator you type.

In this example, the operator is "plus" and the insertion point held the entire denominator. That's why the entire denominator becomes the first operand of the plus. Note the placeholder waiting for you to supply the second operand of the plus.

The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operator you type.

In this example, the operator is "square root" and the insertion point held the entire denominator. As a result, the entire denominator becomes an operand of the square root. This causes it to go inside the square root as shown.

The Insert key toggles the insertion line from one side to the other. Since the vertical arm was on the right, pressing Insert makes it jump to the left.


Editing an expression (generally)

Editing an expression

Editing an expression involves two steps:

Putting the right part of the expression between the editing lines.

Pressing the correct key.

The meaning of each keystroke depends on what's between the editing lines. Click on any of the expressions below to see what the most common editing keystrokes will do when the editing lines are in the position shown.


Editing Lines

Where can they appear?

How do you make them appear?

How do you move them around?

What are they for?


Editing Links

Once you’ve linked an object into a worksheet using Insert Object or Paste Special, you can update the link, change it, or eliminate it. To do so:

Choose Links from the Edit menu to bring up the Links dialog box.


Editing the S-Plus Script Component

To enter or edit your S-PLUS code in the S-PLUS script component:

  1. Open the Script Editor by clicking the right mouse button on the component and choosing Edit Script from the component's pop-up menu.

  2. Edit the script code.

  3. Choose Close & Return from the Script Editor's File menu.

When you click outside the When you click outside the component, the script is executed. If the text of an S-PLUS program cannot be parsed (for example, if it contains an unmatched parenthesis), or if an error occurs when it is executed, a pop-up window appears.


Editing the Script of a Control

To edit the script of a Mathsoft Control:

  1. Right click on the control and select Edit Script from the popup menu.

  2. Make your changes and close the Script Editor.

  3. To update the control in your Mathcad worksheet, select Calculate Worksheet from the Tools menu or click on the control and press [F9].

Note:

  • You cannot send a string as input to any Mathsoft Control. Scalars, vectors, and matrices are the only types of input variables allowed. However, you can define an output variable as a string in a Mathsoft Control. See "Programming" in the QuickSheets for a number of examples of Mathsoft Controls.

  • The Developer's Reference provides more information about the properties, methods, and events associated with Mathsoft Controls.


Effective Interest Rate

eff(rate, nper) Returns the effective annual interest rate (APR) given the nominal annual interest rate and the number of compounding periods per year.

Arguments:

rate is the nominal rate at which an investment earns interest per period. rate must be a real scalar. It may be expressed as a decimal such as .0825 or as a percent such as 8.25%.

nper is the total number of compounding periods per year. nper>0.


Eigenvalues and Eigenvectors

Eigenvalue and Eigenvector Functions

eigenvec(M,z)

Returns an eigenvector associated with eigenvalue z of the matrix M.

eigenvals(M)

Returns the eigenvalues of M.

eigenvecs(M)

Finds normalized eigenvectors corresponding to the eigenvalues of the matrix M.

genvals(M,N)

Finds generalized eigenvalues.

genvecs(M)

Finds generalized eigenvectors.

Launch QuickSheet Example


Eigenvalues Equation


E-books

A Mathcad E-book is a collection of hyperlinked, interactive worksheets on a certain topic.


Embedded Font Codes

Embedded font codes such as “MFNT_03_” preceding a variable name indicate the font in which the variable name is to appear.


Embedded Object

An object which, when double-clicked on, opens the application that created it and places a copy of itself into the application window. Or, if the application supports in-place activation, menus and toolbars change to those of the other application and a hatched border surrounds the object.

Any changes you make will only affect only the object in the worksheet. This is analogous to making a photocopy and marking up the copy while leaving the original undisturbed.


Empty Space

This refers to the space between regions. Whenever you click in empty space, you see a red crosshair ('+').

The blank spaces that separate variables and operators in an equation are not considered empty space.


Encountered a file i/o error.

Mathcad was not able to properly read in data from a data file. Check that you are not trying to read data points that do not exist in the file.


End Key Movement

In blank space...

Moves the crosshair beside the next region. If the crosshair is already at the last region, this does nothing.

In math...

Moves the editing lines to the end of the expression. If the editing lines are already there, this does nothing.

In text...

Moves the text insertion point to the end of the line. If the insertion point is already there, this does nothing.


End of File

You've tried to read more data values from a data file than there are values in that file. For example, if your data file has only ten numbers in it, and you type...

i:1;100

x[i:READ(file)

You'll see this message.


End points cannot be the same.

The endpoints of the interval on which the solution will be evaluated must be different. This message commonly occurs with the differential equation solvers.


Enhancing Image Contrast


Enter Key Movement

In blank space...

Moves the crosshair one space down and all the way back to the left edge of the worksheet.

In math...

Makes the editing lines jump out of the expression and turn into a crosshair in the empty space below.

In text...

Starts a new line in a new paragraph.


Entering Binary Numbers

To enter a binary number:

  1. Type the digits making up the number. Valid digits are the numbers 0 and 1.

  2. Type the letter "b" (or "B") immediately following the last digit in the number.

For example:

    1101b

Note:

Because of implied multiplication the worksheet may add a small space between the final digit and the "b". You will need to delete this space by placing the insertion bar to the right of it and hitting backspace. The binary number needs to be represented without any spaces.

Launch QuickSheet Example


Entering Complex Numbers

To enter a complex number:

  1. Type the real part.

  2. Type "+" (or "-").

  3. Type the imaginary part.

  4. Type i or j. There should be no space between the imaginary part and the i or j.

For example:

1 + 2i 1 - 33.4j

3 + 1i 2 - 1j

When using complex numbers, you may find the special functions and operators for working with complex numbers useful.

Launch QuickSheet Example


Entering Hexadecimal Numbers

To enter a hexadecimal number:

  1. If the first digit of the number is one of the letters a through f, you must start that number with a "0". If you don't, whatever you type will be interpreted as a variable and not as a number.

  2. Type the digits making up the number. Valid digits are the numbers 0 through 9 and the letters a through f.

  3. Type the letter "h" (or "H") immediately following the last digit in the number.

For example:

  1. 2b3ch

  2. 0a32H

Note:

Because of implied multiplication the worksheet will add a space between the final digit and the 'h'. The worksheet will also try to place a space between hexadecimal characters (a - f) and numeric numbers (0-9) as well. You will need to delete this space by placing the insertion bar to the right of it and hitting backspace. The hex number needs to be represented without any spaces.

Launch QuickSheet Example


Entering Imaginary Numbers

To make a number imaginary, type i or j immediately following it. For example,

i -33.4j

1i

1j

If you type either i or j by itself, it will be treated as a variable name and not as the imaginary unit. To enter the imaginary numbers i and j in your worksheet, you must type "1i" or "1j". The digit "1" disappears as soon as you click outside the number.

Although you can enter imaginary numbers followed by either i or j, the worksheet normally displays them followed by i. To display imaginary number with j, choose Result from the Format menu to see the Result Format dialog box.


Entering Numbers Greater Than 999

Entering Numbers > 999

When entering numbers greater than 999, do not use either a comma or a period to separate digits into groups of three. Simply type the digits one after another.

For example, to enter ten thousand, type"10000". Do not type either "10,000" or "10.000".

A comma is used only in the context of range variables and array subscripts. A period is used only to indicate a decimal point or a literal subscript.


Entering Numbers in Scientific Notation

To enter a number in scientific notation:

  1. Type the number you're going to raise to a power of 10.

  2. Type "*10^".

  3. In the empty placeholder, type the appropriate power of 10.


Entering Numbers to Other Bases

You can enter numbers in binary, octal, or hexadecimal rather in decimal form. Click on the appropriate topic below to learn how to enter a nondecimal number.

Entering binary numbers

Entering hexadecimal numbers

Entering octal numbers


Entering Octal Numbers

To enter an octal number:

  1. Type the digits making up the number which must be real. Valid digits are the numbers 0 through 7.

  2. Type the letter "o" (or "O") immediately following the last digit in the number.

For example:

    32o

Note:

Because of implied multiplication the worksheet may add a small space between the final digit and the 'o'. You will need to delete this space by placing the insertion bar to the right of it and hitting backspace. The octal number needs to be represented without any spaces.

Launch QuickSheet Example


Equal Sign for Definition (:=)

How to type it...

What it does...

Restrictions on left of ":="...

Restrictions on right of ":="...

How to change its appearance


Equal sign for evaluation (=)

How to type it...

What it does...

Restrictions on left of "="...

Restrictions on right of "="...


Equal to Operator

Keystroke: Ctrl+=

x [image] y

Returns 1 if x = y, 0 otherwise.

Operands:

  • x and y can be real or complex scalars or arrays.

You can change the display of this operator to = if you want to.


Equals Signs

There are two fundamentally different types of equal sign. These are:

The evaluation equals sign

The assignment equals sign

Note that neither of these equal signs really amounts to an assertion that two sides of an expression are equal. Note further that it's possible to evaluate expressions symbolically rather than numerically, if you'd like your answer in terms of variables.


Equation format dialog box

The Equation Format dialog box has the following options:

Style Name

Provides a drop-down list of math styles to modify:

Variables is the style use for all variables in the worksheet.
Constants is used for all the numbers in the worksheet.
User1, User2, etc. are styles you can modify, name, and apply to individual constants or variables.

New Style Name

Type a new name here if you want to change the name of the selected style. Usually you only need to do this for the User1, User2, etc. styles.

Modify

Click this to change the font, style, size, or color of a selected style.

Default Equation Color

Changes the default color for variables and constants.


ERR - Variable

The built-in variable ERR gives the size of the error vector for the approximate solution.

There is no built-in variable for determining the size of the error for individual solutions to the unknowns.


The function values must be of opposite signs.

The function values on the two bracket end points must be of opposite signs.

When you use the bracket version of the root function, the third and fourth arguments are the "brackets." Mathcad tries to find a solution between the brackets. The function evaluated at the first bracket must be the opposite sign of the function evaluated at the second bracket. For example:

f(x):=sin(x+10)

x:=1

root(f(x),x,1,8)

gives an error because f(1)=-1 and f(5)=-.751. Try graphing the function to see where the root might lie and use values to the left and right as brackets. In the example above, you can use root(f(x),x,1,5) instead.


This is not a valid interval.

Some functions require two arguments which indicate the beginning and end of an interval. The beginning value must be smaller than the end value.

For example, the runif function requires two arguments a and b, where a and b are the endpoints and a must be smaller than b.


The format of this vector is invalid

Some functions require an argument that is the result of another function. Even though this argument is just a vector, it must be in a special format that only another function can create.

For example, the first argument to interp must be a vector generated from a spline function.


There must be more data points than parameters.

The regress function requires three arguments:

  • vx is a vector of real data values.

  • vy is a vector of real data values.

  • k is a positive integer specifying the order of the polynomial you want to use to fit the data.

You will see this error if k is larger than or equal to the number of values in vx and vy. To find out how many values are in vx or vy, enter rows(vx) or rows(vy).

The genfit function requires that you have more data points than unknown parameters. Click on the function name in your worksheet and press F1 for additional information about genfit.


The number of rows must be a power of 2.

This error marks a wavelet transform whose argument has the wrong number of elements. The argument must be a vector with 2n elements.


This image format is not supported.

The specialized functions for reading images such as READ_IMAGE, READ_RED, etc. can read only files of the following formats: BMP, JPG, GIF, PCX, and TGA.


Matrix must be positive definite.

This error appears when the matrix argument to a function must be positive definite and it is not. A matrix is positive definite if all its eigenvalues are real, positive numbers and vice versa. For example:

R is positive definite but M is not.


Error Function and Complementary Error Function

The error function is related to the complementary error function by the following relation:

erfc(x) := 1 - erf(x)

Arguments:

x is a dimensionless, complex scalar.


Error in ODE Block

Mathcad encountered an error on your ordinary differential equation (ODE) solve block. This error could have been cause by one of several different factors:

  • Your solve block specifies derivatives of more functions than there are equations (n equations in n unknown functions).

  • Your constraints are insufficient or overrestritive for the number of unknown functions. The number of conditions must be equal to the sum of the orders of the ODEs.

  • The solver was unable to interpret the system of ODEs: you should check your function names, check that all functions are specified with the variable (x(t), not just x), check that all derivative initial conditions are given using prime notation [Ctrl F7], and that ODEs are linear in their highest-order derivatives. See the description of Odesolve for more details.


Error Messages in Symbolic Calculations

The messages you may see during symbolic calculation include:

Argument too large

Discarding huge result

Expecting array or list

Expression contains nonsymbolic operators

Floats not handled

Illegal function syntax

Integer too large

Invalid arguments

Invalid range

No answer found; stack limit reached

No answer found

No closed form found for . . .

Object too large

Syntax error


Euler's Constant


Euler's Gamma Function

lnG(x) Returns ln(G(x)), and may be successfully evaluated in cases of very large x, where G(x) returns overflow errors.

Arguments:

z is a dimensionless, complex scalar.

x is a dimensionless, real scalar.


Gamma functions

G(z) Returns the value of the Euler gamma function of z.

G(a,x) Returns the value of the incomplete gamma function of x with parameter a.

lnG(z) Returns the natural log of the Euler gamma function, evaluated at z.

Arguments:

z is a real or complex scalar. z cannot be 0, -1, -2...

a is a positive real scalar.

x is a positive real scalar.

The Euler gamma function is given by:

The incomplete gamma function is given by:

The following relationships involving the gamma functions may be useful:

(a,0) = [image] (a)

(z + 1) = z [image] (z)

(z). (1 [image] - z) = p . csc(p . z)

(n + 1) = n!

Notes:

  • For complex z, [image] (z) is the analytic continuation of the real function.

  • For z = 0, -1, -2... (z) is undefined.


What the Equal Sign for Definition Does

Evaluates whatever is on the right of the ":=" and assigns the result to whatever is on the left of the ":=".


Evaluating "="

Evaluates whatever is on the left of the "=" and displays the answer to the right of the "=".


Evaluating a Function

To evaluate a user-defined function:

  1. Click below the definition of the function to position the crosshair and type the function name followed by a left parenthesis.

  2. Type a list of arguments separated by commas followed by a right parenthesis.

  3. Press the “=”


Evaluating an Expression Over a Range

Repeated or iterative calculations are calculated as easily as individual ones by using a range variable. A range variable is a variable that takes on a sequence of values.

To compute equations for a range of values:

  1. Define a range variable.

  2. Evaluate an expression involving the range variable.


Evaluation Pass through a Worksheet - Step 1

The ":=" assigns the value "1" to the variable "x". To insert the ":=" type the colon (:) key.

The black dot on the left is the "anchor point". This point defines exactly where this definition is. To see anchor points, choose Regions from the View menu.


Evaluation Pass through a Worksheet - Step 2

This defines a function f(z). Note that z doesn't have to be defined because it's used only as a dummy argument. After all, you don't really have to know what z is to define a function with it.


Evaluation Pass through a Worksheet - Step 3

The "=" takes the current value of x and displays it to the right.


Evaluation Pass through a Worksheet - Step 4

This evaluates the function f at the current value of x.


Evaluation Pass through a Worksheet - Step 5

This redefines x. Above this point, x is still set to 1. Below this point, x is set to 33.


Evaluation Pass through a Worksheet - Step 6

This evaluates the function f at the current value of x. Since x is now 33, f(x) = 3x = 99.


Evaluation Pass through a Worksheet - Step 7

This plot is incorrectly placed because the anchor point (the black dot on the left) is above the anchor point at which u is defined. As a result, u is not yet defined when this plot is evaluated. Note that undefined variables are displayed in red.


Evaluation Pass through a Worksheet - Step 8

This defines u as a range variable by assigning to it the sequence 1, 2, 3...10. Range variables are indispensable for creating plots.

To insert the ".." type the semicolon (;) key.


Evaluation Pass through a Worksheet - Step 9

This plot is correctly placed. Both the range variable u and the function f are defined before the anchor point on the upper left corner of this plot.


Evaluation Toolbar

The Evaluation toolbar buttons gives you quick access to evaluation and customized operators. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Sorting Data in a Matrix According to One Column

csort(A, n) Returns an array formed by rearranging rows of A until column n is in ascending order.

Arguments:

A is a matrix.

Keep in mind that matrices are numbered starting with row one and column one unless you change the ORIGIN. The default origin is 1.


Example of Highlighted Text


Sorting Data in Reverse Order

reverse(v) Returns a vector in which the elements of v are in reverse order.

Arguments:

v is a vector.


Sorting Data in a Matrix According to One Row

rsort(A,n) Returns an array formed by rearranging columns of A until row n is in ascending order.

Arguments:

A is a matrix.

Keep in mind that matrices are numbered starting with row zero and column zero unless you change the ORIGIN.


Example of Selected Text


Sorting Data in Ascending or Descending Order

sort(v) Returns a vector with the values from v sorted in ascending order.

Arguments:

v is a vector.

Keep in mind that matrices are numbered starting with row zero and column zero unless you change the ORIGIN.

To sort a vector into descending order, use the function reverse(v) as follows:

reverse(sort(v))


Examples of Contour Plot Formatting

A contour plot colored filled according to a colormap:

A contour plot with no fill:

A contour plot with a grayscale colormap:

A contour plot with 8 contours:

A contour plot with numbered contours:


Examples of Surface Plot Formatting

A surface plot colored with a colormap:

A surface plot colored with a grayscale colormap:

A surface plot with a wireframe (left) and no lines (right):


Excel Component Properties: Inputs

Use the Inputs tab of the Excel Properties dialog box to specify which cells in the Excel component the input will be stored. If the input is a single value, enter the cell in which it will be stored. If an input consists of more than one value, enter the starting cell.

Each input variable will send values from your worksheet to the cells in an Excel worksheet. Enter any valid Excel cell range. For example, enter C2:L11 to indicated the cells C2 through L11. You can also enter named cells.

To specify a particular Excel worksheet and cell range, enter worksheet name and an exclamation point before the cell range. For example, enter Sheet2!B2:C2.


Excel Component Wizard - Additional Pages

Pages of the Excel component Wizard allow you to specify:

  • The number of input and output variables. You can supply any number of input variables and output variables.

  • Inputs

  • Outputs


Excel Component Wizard - First Page

To use the first page of the Excel component wizard:

  • If you want to connect a file you’ve already created, choose “Create from file,” and type the path name in the text box or use the Browse button to locate the file; then click “Open.” If you don’t want to connect to a previously created file, choose “Create an empty Excel Worksheet.”

  • Click the Display as Icon box if you want to see an icon in your worksheet rather than a portion of the Excel file.


Exclusive Or (XOR) Operator

Keystroke: Ctrl+Shift+5

x [image] y Returns 1 if either x or y, but not both, are non-zero (true). Returns 0 otherwise.

Operands:

  • x and y are real or complex scalars.

Note:

A value of 0 is FALSE, any non-zero value is TRUE.

Launch QuickSheet Example


Exiting

Choose Exit from the File menu to exit completely.

If any changes have been made to any open worksheet since it was last saved, you'll be prompted to save them before quitting.


Symbolics - Expand

Expands all powers and products of sums in the selected expression.


Expand to Series

Derives a power series for an expression with respect to a variable you select in that expression. A dialog box allows you to choose the order of the series.


Expanding a Collapsed Area

Once you've collapsed an area, and successfully hidden the regions that were inside it, you can expand the area to see the hidden regions. To expand an area:

1. Click the collapsed area bar:

2. Choose Area / Expand from the Format menu.

The collapsed bar now appears as two bounding bars and the hidden regions appear between the boundaries:

Regions that were below the collapsed bar move down as necessary.

Note: If a collapsed area is locked, you must unlock it before expanding it.


Expanding Expressions

To multiply out powers and products of polynomials:

  1. Enclose the expression (or subexpression) you want to expand between the editing lines.

  2. Choose Expand from the Symbolics menu.

Specifics about the expansion of an expression:

  • If the expression is a fraction, the numerator will be expanded and the expression will be written as a sum of functions.

  • Sines, cosines, and tangents of sums of variables, or integer multiples of variables will be expanded as far as possible into expressions involving only sines and cosines of single variables.

  • If the expression can't be expanded further, this command returns it unchanged.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "expand" keyword and live symbolic evaluation instead.

Launch QuickSheet Example


Expecting Array or List

Operators in the expression you are simplifying or evaluating require vector or matrix operands.


Exponential Distribution

Distribution generators for the Exponential Equation:

dexp(x,r) Returns the probability density.

pexp(x,r) Returns the cumulative probability distribution.

qexp(p,r) Returns the inverse cumulative probability distribution.

rexp(m,r) Returns a vector of m random numbers having the exponential distribution.


Exponential Functions - Numerical Issues

Because functions are evaluated using double precision floating point numbers, round-off errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

exp and e^x

The exp function uses an algorithm different from simply raising an approximate value for e to a power. For very large or small values in the exponent, the exp function is more robust.

The most accurate values for very large arguments can be found by using symbolic evaluation of exp(x) with a decimal argument for x - for example, exp(300000).


Exponential Integral


Exponential Regression

expfit(vx, vy, [vg]) Returns a vector containing the coefficients for an exponential curve of the form ae(bx)+c that best approximates the data in vx and vy. vg, if used, contains guess values for the three coefficients.

Arguments:

  • vx is a vector of real data values. The values in vx correspond to the x values.

  • vy is a vector of real data values. The values in vy correspond to the y values.

  • vg is a three-element vector of real guess values for the parameters a, b, and c in the exponential equation:

Note: vx and vy must have the same number of elements.


Exponentiation operator

Exponentiation

Keystroke: ^

This returns y raised to the x power.

Operands:

x and y are scalars.

x must be dimensionless.


Exporting Data

You can export or write worksheet calculations to a data file, or you can place the results on the clipboard for pasting into another application.

Exporting data once to a data file

Writing data interactively to a data file using components

Writing data interactively to a data file at the command line, using WRITEPRN or APPENDPRN functions.

Writing binary data to a data file

Placing data on the clipboard


Exporting Data to a File (defined)

Exporting Data to a File

To send data out of a worksheet into an external data file in a one-time fashion.


Expression contains Nonsymbolic Operators

You're applying a symbolic operation to an expression containing operator or variable placeholders.


Expression Type

IsScalar(x)

Returns 1 if x is a scalar, otherwise returns 0.

IsArray(x)

Returns 1 if x is a vector or matrix, otherwise returns 0.

IsString(x)

Returns 1 if x is a string, otherwise returns 0.

UnitsOf(z)

Returns the units of z. Returns 1 if z has no units.


Extension Packs

A Mathcad Extension Pack, like an Electronic Book, is a collection of several hundred hyperlinked, interactive Mathcad worksheets. Unlike an E-book, an Extension Pack adds additional functions to Mathcad. For example, the Signal Processing Extension Pack adds functions for designing digital filters.


F Distribution

Distribution generators for the F-Distribution Equation:

dF(x,d1,d2) Returns the probability density.

pF(x,d1,d2) Returns the cumulative probability distribution.

qF(p,d1,d2) Returns the inverse cumulative probability distribution.

rF(m,d1,d2) Returns a vector of m random numbers having the F distribution.

Launch QuickSheet Example


Symbolics - Factor

Factors the selected expression into a product if the entire expression can be written as a product. To factor a sub-expression of a larger expression, select the sub-expression. Use this command to combine a sum of fractions into a single fraction.


Factorial operator

Factorial

Keystroke: !

n!

Returns n(n-1)(n-2)...1

Operands:

n must be a nonnegative integer.

Factorials for n>170 will overflow when evaluated numerically. Large factorials can nevertheless be evaluated by the symbolic processor.

For fractional factorials, use the gamma function using this relationship:

G(n+1) = n!


Factoring Polynomials

To rewrite an expression as a product of terms:

  1. Enclose the expression (or subexpression) you want to factor between the editing lines.

  2. Choose Factor from the Symbolics menu.

Notes:

  • This command will not factor any expression containing constants with decimal points.

  • When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "factor" keyword and live symbolic evaluation instead.

Launch QuickSheet Example


FFT of Complex Data (cfft/CFFT Functions)

FFT of Complex Data

cfft(A) Returns the Discrete Fourier Transform of a vector or matrix. The result has the same number of rows and columns as A. If A is a vector, the result is given by:

Where n is the number of elements in v. For matrix arguments, cfft returns the two-dimensional Fourier transform.

CFFT(A) Returns the Discrete Fourier Transform of a vector or matrix. The result has the same number of rows and columns as A. If A is a vector, the result is given by:

Arguments:

  • A can be a complex vector or matrix of any size, although the function will work faster when the number of elements in the vector is 2m. A vector whose length is a large prime number will slow down the discrete Fourier transform algorithm.

Notes:

  • If A is a real-valued vector that has 2m elements (m>2), use fft/FFT instead. For such vectors, the second half of the spectrum is the complex conjugate of the first and need not be computed.

  • The frequency associated with the kth element in the calculated FFT spectrum is given by

    where fs is the sampling frequency of the original signal and n is the number of samples. As a consequence, since k must be an integer, spreading in the spectrum will occur unless the sampling frequency is chosen so that

    is always equal to an integer for any period 1/T in the signal.

  • The sampling frequency is distinct from the frequency(ies) of the original time-domain signal.

  • If you use cfft to get to the frequency domain, you must use cifft to get back to the time domain. If you use CFFT, you must inverse transform with CIFFT.


FFT of Real Data (fft/FFT Functions)

FFT of Real Data

fft(v) Returns the Fast Fourier transform of a vector. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

FFT(v) Returns the Fourier transform of a vector. The result is a [image] element vector whose kth element is given by:

Arguments:

  • v is a real-valued vector with [image] elements (m>2).

Notes:

  • The frequency associated with the kth element in the calculated FFT spectrum is given by

    where fs is the sampling frequency of the original signal and n is the number of samples. As a consequence, since k must be an integer, spreading in the spectrum will occur unless the sampling frequency is chosen so that

    is always equal to an integer for any period 1/T in the signal.

  • The sampling frequency is distinct from the frequency(ies) of the original time-domain signal.

  • If you use fft to get to the frequency domain, you must use ifft to get back to the time domain. If you use FFT, you must inverse transform with IFFT.

  • The fft/ifft functions take advantage of the complex conjugate symmetry of the fourier transform, which only applies for real input data. Mathcad does not calculate the second half of the frequency spectrum to save time and memory. For vectors with complex values, or with an arbitrary number of elements, use cfft or CFFT instead. Likewise, for 2-dimensional Fourier transforms, use cfft/CFFT instead.


File - Check In

Allows you to save your changes to a worksheet stored in a SharePoint repository. This option is available only when the active worksheet has been checked out of SharePoint.


File - Check Out

Allows you to open a file from a SharePoint repository with the ability to save your changes back into the repository. This option is available only when the active worksheet has been opened from SharePoint as read-only. Once a worksheet has been checked out, this menu option is replaced by one to check in your worksheet.


File - Close

Closes the active worksheet.

If any changes have been made since the worksheet was last saved, you'll be asked if you want to save the current worksheet.


File - Close & Return

Closes the active worksheet displaying an embedded object. If any changes have been made since the worksheet was last saved, you'll be asked if you want to save the current worksheet. This command is only available when you are editing a worksheet object that is embedded in another application and you are editing in separate window as opposed to in-place.


File - Exit

Exits the program.

To close just the worksheet you are working on without exiting the program completely, choose Close from the File menu.


File - New

The New command from the File menu opens a dialog displaying a list of templates to choose from. Choose Normal Worksheet to create an empty, untitled worksheet.

To create a new worksheet based on the Normal template, click the first button on the Standard toolbar. To create a new Template, choose Save As... Template from the File menu.


File - Open

Displays a scrolling list of worksheets in the current directory. Double-click on the name of the worksheet to open it. If your worksheet is located elsewhere on your computer or network, you can navigate to it by changing the selection in the Look in drop-down, or by manually entering the full path to the file in the File Name box.

Use the Files of Type box to open another kind of file.

If you have created a directory in your Network Places that maps to a Web Server using Windows 2000 or XP WebDAV support, you will be able to browse and open files from the server through this dialog. You can also type URLs directly into the File Name box.


File - Page Setup

Brings up a dialog box that lets you control:

  • All four margins.

  • Whether or not to print regions beyond the right margin.

  • Paper size, source, and orientation.


File - Print

Brings up a dialog box from which you select:

  • Whether to print the entire worksheet, a range of pages, only the regions you have selected, or the currently active page. The current page is the page on which the red crosshair appears, and not necessarily the page currently visible in the application window.

  • The page range to print.

If you have selected a plotter as your output device, you will only be able to print one page.

The settings you choose affect only the current print job.


File - Print Preview

Changes the screen to show the current page of your worksheet as it will appear when printed. You can scroll through your worksheet using the “Next Page” and “Prev Page” buttons at the top of screen, or print your worksheet using the “Print” button.


File - Recent Files

Listed at the bottom of the File menu are recently opened worksheets. Clicking on one of the worksheets listed here will open that worksheet.


File - Save

If a worksheet is new, this command prompts you for a name. If the worksheet was previously saved, this replaces the copy on disk with whatever is in the window.

Gives you the option to save a file as a worksheet, an old version worksheet, a RTF (Rich Text Format) file, or an HTML/MathML file.


File - Save As

Prompts you for a new name under which to save the current worksheet. Gives you the option to save a file as:

  • A Mathcad 11 worksheet (*.mcd)

  • A Mathcad 2001i worksheet (*.mcd)

  • A Mathcad 2001 worksheet (*.mcd)

  • A Mathcad 2000 worksheet (*.mcd)

  • A Mathcad 8 worksheet (*.mcd)

  • A Mathcad 7 worksheet (*.mcd)

  • A Mathcad 6 worksheet (*.mcd)

  • A template (a document that sets styles and tabs for new Mathcad worksheets)

  • An RTF (Rich Text Format) file for Microsoft Word.

  • An HTML/MathML file


File - Save As Web Page

Prompts you for a new name under which to save the current worksheet with a .htm extension. The current worksheet name is the default. Once you click Save, you will get a second dialog of preferences, including

  • Format to use for equation region export (images, MathML)

  • Format to use for images (.jpg, .png)

  • Format to use for layout (absolute, relative positioning)

  • Template wrapper file, if desired

  • Page title, if desired

  • Option to open the saved page immediately in your default browser.

All HTML files saved by Mathcad will still be calculable by Mathcad as a result of content MathML stored inside the markup. This information is saved regardless of the display mechanism chosen for equation regions (images, presentation MathML). The only exception to this is for protected files, in which case only display information can be saved.

More information can be found under Creating Mathcad Files for MathML Export in the Author's Reference.


File - Save Copy As

Prompts you for a new name under which to save the current worksheet. Gives you the option to save a file as a worksheet, a old version worksheet, an RTF (Rich Text Format) file. This command is only available when you are editing a Mathcad object that is embedded in another application and you are editing in separate window as opposed to in-place.


File - Send

Mails your worksheet using any compatible mail system. You must be connected to a mail server to use this command.


File - Update

Changes are reflected in the copy of the worksheet that is contained in another application. This command is only available when you are editing a object that is embedded in another application and you are editing in separate window as opposed to in-place.


File Access Functions

Importing and Exporting Files

READPRN("file")

Reads an array of values from an ASCII data file.

WRITEPRN("file")

Writes an array of values to an ASCII data file.

APPENDPRN("file")

Appends an array of values to an existing ASCII data file.

READBIN("file", "type", [[endian], [cols], [skip], [maxrows]])

Reads an array of values from a binary data file.

WRITEBIN("file", "type", endian)

Writes an array of values to a binary data file.

READRGB("file")

Reads a color image file.

READBMP("file")

Reads an image file as a grayscale image.

WRITERGB("file")

Creates a color image file.

WRITEBMP("file")

Creates a grayscale image file.


This file could not be opened. Make sure it exists.

The data file or other external file you are trying to import is not found or a data file you are trying to write to is read-only.

Make sure you've specified the path to the file correctly and that the file exists there. Also verify that the file is not read-only. Keep in mind that you must specify the full path to a file unless the file is located in the program folder.


File Menu Commands

New...

Open...

Update

Close

Close & Return

Save

Save As...

Save as Web Page...

Send...

Page Setup...

Print Preview

Print...

List of Recently Opened Worksheets

Exit


Filename

Filename (defined)

A filename is the name for a file including the extension.

Example: tuba.txt.


Filtering Data

To filter your data before reading from an ODBC component, you can query your database directly through the ODBC component using a SQL “where” statement.

To filter your data through the ODBC component:

  1. Right-click the component and choose Properties from the pop-up menu.

  2. Under the Advanced tab, check the “Use SQL” option and type a “where” statement in the text box.

  3. Click “OK” to close the dialog box and update your worksheet.

The figure below shows a SQL “where” statement being used:


Finance Functions

cnper(rate, pv, fv)

Calculates the number of compounding periods for an investment to yield a specified future value.

crate(nper, pv, fv)

Calculates the fixed interest rate per period required for an investment to yield a specified future value.

cumint(rate, nper, pv, start, end, [type])

Calculates the cumulative interest paid on a loan.

cumprn(rate, nper, pv, start, end, [type])

Calculates the cumulative principal paid on a loan.

eff(rate, nper)

Calculates the effective annual interest rate.

fv(rate, nper, pmt, [[pv], [type]])

Calculates the future value of an investment.

fvadj(prin, sched)

Calculates the future value of an initial principal after applying a series of compound interest rates.

fvc(rate, list)

Calculates the future value of a series of cash flows earning a specified interest rate.

ipmt(rate, per, nper, pv, [[fv], [type]])

Calculates the interest payment on an investment for a given period.

irr(list, [guess])

Calculates the internal rate of return for a series of cash flows.

mirr(list, finance_rate, reinvest_rate)

Calculates the modified internal rate of return for a series of cash flows.

nom(rate, nper)

Calculates the nominal annual interest rate.

nper(rate, pmt, pv, [[fv], [type]])

Calculates the number of periods for an investment or loan based on periodic payments and a constant interest rate.

npv(rate, list)

Calculates the net present value of an investment by using a discount rate and series of cash flows.

pmt(rate, nper, pv, [[fv], [type]])

Calculates the payments per period for a loan.

ppmt(rate, per, nper, pv, [[fv], [type]])

Calculates the payment on the principal for a given period.

pv(rate, nper, pmt, [[fv], [type]])

Calculates the present value of an investment given constant payments and a fixed interest rate.

rate(nper, pmt, pv, [[fv], [type], [guess]])

Calculates the interest rate per period of an annuity.


Find Dialog Box

The Find dialog box has the following options:

Find what

Enter the character(s) to find.

Match whole word only

Check this to locate a whole word, rather than part of a word, consisting of the character(s) in the "Find what" box.

Match case

Check this to locate character(s) having the same case as those in the "Find what" box.

Find in Text Regions

Check this to locate character(s) in text regions only.

Find in Math Regions

Check this to locate character(s) in text regions only.

Up

Searches above the location of the crosshair.

Down

Searches below the location of the crosshair.

Find Next

Locates the next or previous occurrence of the character(s) in the "Find what" box.


Finding a single eigenvector

eigenvec(M,z) Returns an eigenvector associated with eigenvalue z of the matrix M. The eigenvector is normalized to unit length.

Arguments:

M must be a square matrix.

z should be an eigenvalue of M.

z can be complex.


Finding Eigenvalues

eigenvals(M) Returns a vector whose elements are the eigenvalues of M.

Arguments:

M must be a square matrix.

z should be an eigenvalue of M.

z can be complex.


Finding Eigenvectors

Finding All Eigenvectors of a Matrix

eigenvecs(M) Returns a matrix containing the normalized eigenvectors corresponding to the eigenvalues of the matrix M. The nth column of the matrix returned is an eigenvector corresponding to the nth eigenvalue returned by eigenvals.

Arguments:

M must be a square matrix.

z should be an eigenvalue of M.

z can be complex.

Launch QuickSheet Example


Finding the Coefficients of a Polynomial

To rewrite an expression as a polynomial, either in a particular variable or with respect to a subexpression:

  1. Select the subexpression in which you want your expression to be regarded as a polynomial.

  2. Choose Polynomial / Find Coefficients from the Symbolics menu.

You'll see a vector containing the coefficients of the equivalent polynomial. The first element of the vector corresponds to the constant term.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "coeffs" keyword and live symbolic evaluation instead.

Launch QuickSheet Example


Fitting Arbitrary Functions to Data

genfit(vx,vy,vg,F) A vector containing the parameters that make a function f of x and n parameters u1...un best approximate the data in vx and vy.

Arguments:

  • vx is a vector of data values. These correspond to the x values.

  • vy is a vector of real data values which correspond to the y values. The number of elements is the same as vx.

  • vg is either an n element vector of guess values for the n parameters, or vg is a scalar in the case where n=1.

  • F is a function that returns an n + 1 element vector containing the function f and its partial derivatives with respect to its n parameters. When n=1, F is a scalar.

  • n is an integer.

Notes:

  • This function is useful when you have a set of measured x and y values and you want to fit an arbitrary function to your data.

  • The vector of guess values is needed for initialization.

The example below illustrates the use of genfit:

Launch QuickSheet Example


Fixing Errors

If your worksheet contains several expressions with errors, do the following:

  1. Determine which expression with an error is closest to the top of the worksheet. This error is probably the cause of many of the other errors. (If a user-defined function is marked in error, check the function definition to find the actual source of the error.)

  2. Press Shift F1 and click on the error message to find out what might be causing the error. Alternatively, look for the error in the list of errors provided in the Help.

Often, the cause of an error is not in the expression issuing the error, but in a previous expression. Use the error-tracing feature to find such an error.

Once you have determined which expression caused the error and why, edit that expression to fix the error. When you click in the expression and begin editing, the error message is removed. When you click outside the expression, it is recomputed.


Encountered a floating point error.

You are evaluating a function at a point which is not allowed. For example, the fifth argument to the relax function in Mathcad cannot have zeros in the non-boundary positions of the coefficient matrix.


Floats not Handled

The Factor command has been applied to an expressing containing decimals.


Font

Font refers to the typeface family of the text.


For Loops

Use a for loop when you know exactly how many times you want the body of the loop to execute. To insert a for loop:

  1. Click in the placeholder into which you want to place the for loop.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the for button or press [Ctrl] + ". Do not just type the word "for."

  4. In the placeholder to the left of the "Î", enter the iteration variable.

  5. In the placeholder to the right of the "Î", enter the range of values to be taken by the iteration variable (although you will most often use a range variable here, you can also use a vector, a list of scalars, and vectors separated by commas).

  6. Click the Add Line button to insert placeholders for additional statements if necessary.

If you want the body of the loop to execute until the occurrence of a condition but you don't know exactly how many times this will take, use a while loop instead.

Launch QuickSheet Example


Format - Align Regions - Across

Aligns selected regions to a horizontal line midway between the highest and lowest region.

Note: This action makes it possible to inadvertently cause regions to overlap. If this happens, you can choose Separate Regions from the Format menu.


Format - Align Regions - Down

Aligns selected regions to a vertical line midway between the rightmost and leftmost region.

Note that this action makes it possible to inadvertently cause regions to overlap. If this happens, you can choose Separate Regions from the Format menu.


Format - Area - Collapse

Collapses an area created by choosing Area from the Insert menu. The area boundaries and the regions between them collapse into a single bar which you can move, but which you cannot delete or copy. Regions below the collapsed area move up as necessary.

To expand a collapsed area to see the hidden regions, choose Area - Expand from the Format menu.


Format - Area - Expand

Expands a collapsed an area which was collapsed by choosing Area / Collapse from the Format menu. The collapsed bar appears as two bounding bars, and regions in the collapsed area appear. Regions that were below the collapsed bar move down as necessary.


Format - Area - Lock

Locks an area inserted by choosing Area from the Insert menu. Click in the area you want to lock before using this command.

You can lock the area with or without a password. If you choose to use a password, be sure not to forget it.


Format - Area - Unlock

Unlocks a locked area inserted by choosing Area from the Insert menu. If the area was locked with a password, prompts you for it.


Format - Color - Annotation

Brings up a toolbar of colors for setting the color used to highlight any changes you've made to a worksheet.


Format - Color - Background

Brings up a toolbar of colors for changing the background color of the main worksheet window.


Format - Color - Highlight

Brings up a toolbar of colors for changing the color used when you highlight a region.


Format - Color - Optimize Palette

Optimizes the default color palette to the best possible 256-color palette to display all bitmaps in the worksheet. You should also check Color - Use Default Palette in the Format menu to activate the new default palette.


Format - Color - Use Default Palette

A check next to this option tells the worksheet to use a single default 256-color palette to display the contents of the worksheet if your display driver supports 256 colors.

If there is no check next to this option, the worksheet uses whatever color palette is best for each picture in the worksheet. This may cause the screen to flash as you scroll through the worksheet, as each 256-color bitmap loads a new palette.


Format - Equation

Displays a list of available math styles. A math style is just a shorthand way to refer to a collection of font properties like size, color, font and so on. To change font, click on a name or number, and choose a math style from the list.

To change the font associated with an existing math style, select the style and click “Modify.” Note that when you modify a math style, you change the font of every variable using that style.


Format - Graph - 3D Plot

Controls the characteristics of the selected 3D plot. Use this to control format options such as:

  • the type of plot: contour, surface, scatter or bar chart

  • colors

  • titles

  • gridlines and numbers on axes

For all but contour and vector field plots, you can control:

  • viewing angle

  • vertical scale (how "bumpy" the plot is)

  • back planes, (for 3D plots)

The remaining plot characteristics are tied to the particular type of 3D plot you're formatting.


Format - Graph - Polar Plot

Controls the default characteristics of all polar plots. Use this to control:

  • tick marks

  • gridlines

  • type of curve (bar, line, etc...)

  • type of marker on each curve(none, +, etc...)

  • color of curve

  • how thick the line is

  • legends

  • type of radial axis (linear or log)


Format - Graph - Trace

Allows you to read coordinates directly from the selected plot. This menu item appears only when you have previously clicked in an X-Y or polar plot.


Format - Graph - XY Plot

Controls the default characteristics of all XY plots in the worksheet. Use this to control:

  • tick marks

  • gridlines

  • type of curve (bar, line, etc...)

  • markers used for each point (+, x, etc...)

  • color of curve

  • how thick the line is

  • legends

  • type of axis (linear or log)


Format - Graph - Zoom

Allows you to zoom in on the selected plot for a close-up view. This menu item appears only when you have previously clicked in an X-Y or polar plot.


View - Header and Footer

Brings up a dialog box for defining headers and footers. In addition to just text, headers and footers can have page numbers, the current date and time, and the name of the file you're working on.


Format - Paragraph

Brings up a dialog box where you can change the text paragraph properties such as the alignment and indentation. You can also specify whether the paragraph has bullets or numbers.


Format - Properties

This command brings up a tabbed dialog box. You may perform the following actions, depending on the kind of region(s) selected:

  • Highlight a region in a color you choose.

  • Insert or remove a border around a picture.

  • Display a picture at its original size.

  • Turn a calculation on or off by clicking the “Disable Evaluation” button.

  • Turn Optimization on or off.

  • Set text region properties to control the width and behavior of a text region.

  • Protect a region from being edited when the worksheet is protected.

Note:

You can select multiple regions in your worksheet, including both math and text together, and set common properties for those regions using the Properties dialog box.


Tools - Protect Worksheet

Brings up a dialog box allowing you to safeguard your worksheet. When your worksheet is protected, this menu item becomes Unprotect Worksheet.


Format - Repaginate Now

Rearranges "soft" page breaks so that they do not intersect regions in the worksheet. Choose this command anytime, but be aware than any uncalculated regions will calculate when you choose this command.

Mathcad automatically repaginates before printing or previewing a worksheet to ensure that no region lies across a page break and prints on two separate pages.


Format - Result

Brings up the Result Format dialog box for controlling how numerical results are displayed.

When you click on a particular result and choose this option, you format a single result.


Format - Separate Regions

Separates any overlapping regions in your worksheet.

Note: This command cannot be undone.


Format - Style

Brings up the Text Styles dialog box allowing you to create or modify a text style. If you click on a text region and choose this command, the dialog box allows you to apply a text style to the text region.

As an alternative to choosing Style from the Format menu, you can apply a text style to a text region simply by clicking in the text region and choosing a style from the left-most drop-down list in the Formatting toolbar.


Format - Tabs

Brings up the Tabs dialog box where you can set tab stops for the worksheet. You can also control these tab stops using the worksheet ruler.


Format - Text

Brings up a dialog box for changing the font, size, color, and style of selected text.

This command only affects text. To change fonts in equations, choose Equation from the Format menu.


Format Menu Commands

Equation

Result...

Text...

Paragraph...

Tabs...

Style...

Properties...

Graph - X-Y Plot...

Graph - Polar Plot...

Graph - 3D Plot...

Graph - Trace...

Graph - Zoom...

Color - Background...

Color - Highlight...

Color - Annotation...

Color - Use Default Palette

Color - Optimize Palette

Separate Regions

Align Regions - Across

Align Regions - Down

Area - Lock

Area - Unlock

Area - Collapse

Area - Expand

Repaginate Now


Formatting Text

Changing fonts

Changing paragraph properties

Using text styles


Formatting a 3D Plot

Once you create a 3D graph with one or more plots, you can use a variety of formatting options to control the way the plots and the graph look.

In general, to format a 3D graph:

  1. Double-click on the graph.

  2. Use the options in the multi-tabbed dialog box to format the plot.

On any 3D graph, you can control the appearance of the axes, the backplanes, and the position of the graph. There are also advanced view options and lighting options which control the overall appearance of the graph. Finally, you can add a title or another annotation to the graph.

Every 3D plot can also be formatted with a variety of options for controlling its color, lines, and points. The exact way you format a plot depends on the kind of plot it is. Click on the plot types below to learn more about the settings you may want to control:

  • Surface

  • Contour

  • 3D Scatter

  • 3D bar plot

  • Vector field


Formatting a Data Table

You can change the general appearance of the table and the way the values are displayed in it.

To change the way the numbers are displayed in a Data table:

  1. Right click on the table.

  2. Choose Properties from the pop-up menu.

  3. Go to the Display tab and set the options however you’d like. Use the "Font" button to control the font of the numbers in the table.

To insert rows or columns in a Data table:

  1. Right click in a cell in the table.

  2. Choose Insert Cells or Delete Cells from the pop-up menu.

  3. Click Row or Column and click "OK."

To make the table larger or smaller:

  1. Click on the table.

  2. Move the cursor to one of the handles so that the cursor changes to a double-headed arrow.

  3. Press and hold down the mouse button.

  4. Drag the cursor in the direction you want the table’s dimensions to change.


Found a number with a magnitude greater than...

Found a number with a magnitude greater than 10^307 while trying to evaluate this expression.

Because of limitations inherent in representing numbers in a computer, numbers that are too large cannot be represented. When an expression involves such a number, you'll see this error message.

Sometimes, especially in a complicated calculation, an intermediate result will be too large to represent.


Found a singularity

Found a singularity while evaluating this expression. You may be dividing by zero.

You evaluated a function or performed an operation at an illegal value. For example, you see this error if you divide by zero or if you try to invert a singular matrix.


Fourier Transform (Symbolic)

Fourier Transform

To evaluate the Fourier transform of a function:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform / Fourier from the Symbolics menu:

Mathcad returns a function in the variable w when you perform a Fourier transform. If the expression you are transforming already contains a w, Mathcad avoids ambiguity by returning a function in the variable ww instead. Use the Substitute for Variable command to substitute a different variable or expression for w.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not "know" about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "Fourier" keyword with live symbolic evaluation.

Launch QuickSheet Example


FRAME Variable

This is the built-in variable that drives animations. Do not define this variable in your worksheet. You should only define it in the Animate dialog box.


Framing an Image

To place a box around an image imported using the Picture command on the Insert menu:

  1. Click on the image with the mouse button.

  2. Choose Properties from the Format menu and go to the Display tab of the Properties dialog box.

  3. Click on the box labeled "Show border".

  4. Click "OK."

You may also want to hide the argument that defines the picture such that the frame appears around the borders of the image only. To do so, right-click on the picture and choose Hide Arguments from the pop-up menu.


Fresnel Cosine Integral


Fresnel Sine Integral


Functions for Creating a 3D Plot

Before you create a 3D surface, bar, scatter, or contour plot of a function, you must define a function in your worksheet in one of the following forms:

A single function of two variables

In this type of function, the x and y coordinates of the plot vary, by default, from -5 to 5 with a step size of .5. Each z-coordinate is determined by the function using these x- and y-values.

A single vector-valued function

In this type of function, the independent variables u and v vary, by default, from -5 to 5 with a step size of .5. The x-, y-, and z-coordinates are plotted parametrically according to the definitions in the three elements of the vector using these u- and v-values.

Three functions of two variables

Using this set of functions, the independent variables u and v vary, by default, from -5 to 5 with a step size of .5. The x-, y-, and z-coordinates are plotted parametrically according to the three function definitions using these u- and v- values.

Note:

The function descriptions above assume that you are working in Cartesian coordinates. If your function represents spherical or cylindrical, rather than Cartesian, coordinates, you can automatically convert the function to Cartesian coordinates. Double-click on the plot, go to the QuickPlot Data page of the 3D Plot Format dialog box, and click “Spherical” or “Cylindrical” under Coordinate System.


Functions for creating a space curve

Before you create a space curve, you must define a function in your worksheet in one of the following forms:

A single vector-valued function of one variable

In this type of function, the independent variable u varies, by default, from –5 to 5 with a step size of 0.5. The x-, y-, and z-coordinates of the plot are determined by the functions in each element of the vector using these u-values.

Three functions of one variable

In this type of function triple, the independent variable u varies, by default, from –5 to 5 with a step size of 0.5. The x-, y-, and z-coordinates are plotted according to the function definitions using these u-values.

Note:

The function descriptions above assume that you are working in Cartesian coordinates. If your function represents spherical or cylindrical, rather than Cartesian, coordinates, you can automatically convert the function to Cartesian coordinates. Double-click on the plot, go to the QuickPlot Data page of the 3D Plot Format dialog box, and click “Spherical” or “Cylindrical” under Coordinate System.


Function Optimization

minimize(f, var1, var2,...)

Finds the values at which a function takes on its minimum value.

maximize(f, var1, var2,...)

Finds the values at which a function takes on its minimum value.


Functions for Equation Solving

Find(x,y,...)

Solves a system of equations.

Minerr(x,y,...)

Approximate solution to a system of equations.

root(f(x),x,a,b)

Solves one equation in one unknown.

lsolve(M,v)

Solves a system of equations.

polyroots(v)

Solves for the roots of the polynomial whose coefficients are in v.


Functions Used Symbolically

Built-in functions that retain their meaning when used symbolically include:

  • Trigonometric and hyperbolic functions and their inverses.

  • Logarithmic and exponential functions.

  • The Re and Im functions.

  • The erf function.

  • The gamma function.

  • The mod function.

  • The Heaviside step function.

  • The min and max functions.

  • The identity and eigenvals functions.

In general, these functions mean the same thing for both numerical evaluations and symbolic transformations, but there are three subtle differences:

  • Unlike the numerical mod function, the symbolic mod function requires an integer modulus, and can accept a polynomial as its first argument.

  • Certain of the symbolic inverse trigonometric functions use different branches in the complex plane.

  • The eigenvals function will work symbolically for complex as well as real matrices.


Final-Value Ordinary Differential Equation Solvers

bulstoer(y, x1, x2, acc, D, kmax, s) (smooth systems)
rkadapt(y, x1, x2, acc, D, kmax, s) : systems with varying characteristics

stiffb(y, x1, x2, acc, D, J, kmax, s): stiff systems
stiffr(y, x1, x2, acc, D, J, kmax, s): stiff systems
radau(y, x1, x2, acc, D, kmax, s): stiff systems

These solvers return the final value of the ODE solution at the endpoint of the integration region. The properties of each of these solvers are the same as the corresponding uppercase function.

Arguments:

y must be a vector of n initial values or a scalar.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

acc controls the accuracy of the solution. A small value of acc forces the algorithm to take smaller steps along the trajectory, thereby increasing the accuracy of the solution. Values of acc around 0.001 will generally yield accurate solutions.

D is an n-element vector-valued function containing the first derivatives of the unknown functions.

J is a function which returns the n by (n+1) matrix whose first column contains derivatives and whose remaining rows and columns form the Jacobian matrix for the system of differential equations.

kmax is the maximum number of intermediate points at which the solution will be approximated. The value of kmax places an upper bound on the number of rows of the matrix returned by these functions.

s is the smallest allowable spacing between the values at which the solutions are to be approximated. This places a lower bound on the difference between any two numbers in the first column of the matrix returned by the function.


Fundamental Units

The fundamental units are those used for the fundamental dimensions of length, mass, time, charge or current, temperature, luminosity (SI unit system), and substance (SI unit system). The fundamental units are different for each unit system.

Unit System Fundamental units

MKS meters (m), kilograms (kg), seconds (sec), coloumbs (coul), Kelvin (K)

CGS centimeters (cm), grams (gm), seconds (sec), coloumbs (coul), Kelvin (K)

US feet (ft), pounds (lb), seconds (sec), coloumbs (coul), Kelvin (K)

SI meters (m), kilograms (kg), seconds (s), amps (A), Kelvin (K), candella (cd), moles (mole)


Future Value

fv(rate, nper, pmt, [[pv], [type]]) Returns the future value of an investment or loan over a specified number of compounding periods, given a periodic, constant payment and a fixed interest rate.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate [image] 0.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

nper is the total number of compounding periods. nper is a positive integer.

pmt is the payment made each period. It usually includes principal and interest but no other taxes and fees.

pv (optional) is the present value of the loan. If omitted, pv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.


Future Value of Cash Flows

fvc(rate, v) Returns the future value of a series of cash flows occurring at regular intervals earning a specified interest rate.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%.

v is a vector of cash flows assigned at regular intervals.

Note: fvc assumes that the payment is made at the end of the period.


Future Value (Variable Rate)

fvadj(prin, v) Returns the future value of an initial principal after applying a series of compound interest rates.

Arguments:

prin is the initial principal.

v is a vector of interest rates, each of which are applied over the same amount of time.

Note: Use fvadj to calculate the future value of an investment with a variable or adjustable interest rate.


Gamma Distribution

Distribution generators for the Gamma Equation:

dgamma(x,s) Returns the probability density.

pgamma(x,s) Returns the cumulative probability distribution.

qgamma(p,s) Returns the inverse cumulative probability distribution.

rgamma(m,s) Returns a vector of m random numbers having the gamma distribution.


Gauss Hypergeometric Function

fhyper(a,b,c,x) Returns the value of the Gauss hypergeometric function, 2F1(a,b;c;x).

Arguments:

a, b, and c are real scalars.

x is a real scalar.

x is between -1 and 1.

The Gauss hypergeometric function is the solution to the differential equation:

Many functions are special cases of the Gauss hypergeometric function. For example:

ln(1+x)=x.fhyper(1,1,2,-x)

asin(x)=x.fhyper(.5,.5,1.5,x2)


Generalized Eigenvalues and Eigenvectors

genvals(M,N) Returns a vector v of computed eigenvalues, each of which satisfies the generalized eigenvalue problem.

genvecs(M,N) Returns a matrix containing the normalized eigenvectors corresponding to the eigenvalues in v, the vector returned by genvals. The ith column of this matrix is the eigenvector x satisfying the generalized eigenvalue problem.

Arguments:

M and N must be square matrices.

The elements of M and N should be real.

M and N must have the same number of columns.

Use these functions to find generalized eigenvalues and eigenvectors. To find individual eigenvalues and eigenvectors, use the functions eigenvals and eigenvec.


Generalized Hypergeometric Function


Generating reports

When you use a solve block to solve a system of equations and you have the Solving and Optimization Extension Pack (Expert Solver) installed, you can generate reports on the solution.

To see a report:

  1. Click with the right mouse button on the find, minerr, maximize, or minimize function in the solve block.

  2. Choose Report from the pop-up menu.

The report information depends on the kind of problem:

For nonlinear problems:

The report indicates the number of iterations required to arrive at a solution.

For linear problems:

The report includes information on reduced costs, shadow prices, objective coefficients with allowable increases and decreases, and constraint right-hand side ranges.

Notes:

Allowable Increase and Allowable Decrease for a variable specify a range over which the coefficient of the variable in the objective function can be changed without affecting the point where the optimal value of the objective is assumed. For a variable whose optimal value is zero, the Reduced Cost is an estimate of the rate at which the objective would decrease if the variable were perturbed away from zero.

Allowable Increase and Allowable Decrease for a constraint specify a range of values for the constraint's right-hand side. Within this range, changing the value of the right-hand side of a constraint will change the optimal value of the objective at a rate equal to the Shadow Price for that constraint.

The Slack for a constraint is the difference between the right-hand side and the left-hand side of a constraint at the optimal solution point.


Geometric Distribution

Distributions associated with the Geometric Equation:

dgeom(k,p) Returns the probability density.

pgeom(k,p) Returns the cumulative probability distribution.

qgeom(p,r) Returns the inverse cumulative probability distribution.

rgeom(m,p) Returns a vector of m random numbers having the geometric distribution.


Geometric Mean

Arguments:

  • A, B, C, ... are m x n arrays or scalars.

  • A, B, C, ... must be real and greater than zero. For an array, the elements must be real and greater than zero.

Notes:

  • The geometric mean is useful for calculating growth rates.

  • hmean(A, B, C, ...) < gmean(A, B, C, ...) < mean(A, B, C, ...)

Other functions for data analysis...


Getting a Readout of Polar Plot Coordinates

To see a readout of plot coordinates on any point in a plot:

  1. Click in the plot to select it, then choose Graph / Trace from the Format menu to bring up the Polar Trace dialog box.

  2. In the plot region, click and drag the mouse along the trace whose coordinates you want to see. A dotted crosshair jumps from one point to the next as you drag it along the trace.

  3. You'll see the coordinates corresponding to the location of the crosshair in the "Radius" and "Angle" boxes. These coordinates change as you move the mouse.

  4. When you release the mouse button, you'll see the radial and angular values of the last point you selected shown in the dialog box.

To copy a coordinate value to the clipboard:

Click the "Copy Radius" or "Copy Angle" button to place the corresponding coordinate in the clipboard.


Getting a Readout of X-Y Plot Coordinates

To see a readout of the coordinates on any point on a trace:

  1. Click in the plot to select it.

  2. Choose Graph / Trace from the Format menu to open the Trace dialog box.

  3. In the plot region, click and drag the mouse along the trace whose coordinates you want to see. A dotted crosshair jumps from one point to the next as you drag it along the trace.

  4. You'll see the coordinates corresponding to the location of the crosshair in the "X-Value" and "Y-Value" boxes. These coordinates change as you move the mouse.

  5. When you release the mouse button, you'll see the x and y values of the last point you selected in the dialog box.

To copy a coordinate value to the clipboard:

  • Click the "Copy X" or "Copy Y" button to place the corresponding coordinate on the clipboard.


Global Definition Symbol

Keyboard shortcut is ~ (the tilde key)

Appears as a triple equals.

Use this operator to define a variable or function globally. Variables defined with this operator are evaluated before any variables defined with the definition equal sign.


Global Methods

  • The alert function takes a single string parameter that is presented to the user as a standard modal Windows message box with an “OK” button.

  • The errmsg function takes a single string parameter as its first argument that displays as an error message from within the script and causes the script to stop execution. The second parameter is also a string, but it is optional. It is used to display the source of the error.

Note: In JScript, the names of functions, methods, objects, and properties are case sensitive, while in VBScript they are not.


Note About Global Definitions

Global definitions do not recognize local definitions. Here is an example where a global definition ignores a local definition above it:


Defining a Variable or Function Globally

When you define a variable or function, it applies to everything below and to the right of it. However, when you define a global variable or function it applies to all local definitions, regardless of their location in the worksheet. Thus, global definitions allow you to supersede the usual order in which your worksheet is evaluated.

To define a variable or function globally, follow these steps:

  1. Type a variable name or function to be defined.

  2. Enter the global equals sign by pressing the tilde key (~).

  3. Type an expression involving number or other globally defined variables or functions.


Graph Toolbar

The Graph toolbar buttons allow you to insert 2D and 3D graphs. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Graphics Region

A graphics region is a region containing either:

  • An XY plot

  • A polar plot

  • A surface plot

  • A contour plot

  • A 3D bar chart

  • A vector field plot

  • A scatter plot

  • A graphics image

To create a graphics region, choose the appropriate entry from the Insert menu.


Graphing a Math Expression

To graph a math expression:

  1. Define a range variable for the range of values over which to plot the expression.

  2. Choose Graph / X-Y Plot from the Insert menu to insert the X-Y plot operator.

  3. Click on the placeholder on the x-axis and type the range variable.

  4. Click in the middle placeholder on the y-axis and type the math expression.

  5. Click outside the plot.

Mathcad graphs one point for each value of the range variable and, unless you specify otherwise, connects them with straight lines.

Notes:

  • If you want Mathcad to assign values over which to plot, you do not need to define a range variable. Simply type the undefined variable name in the x-axis placeholder. Mathcad uses -10 to 10 as the default range for the graph. When you let Mathcad choose the default range, you create a QuickPlot.

  • You can graph any expression against any other expression, as long as they share the same range variables. You can also create a graph of more than one curve.

Launch QuickSheet Example


Graphing a Set of Data Points

To graph a set of data points:

  1. Create two vectors. Enter the x-values in one vector and the y-values in another.

  2. Press @ or choose Graph / X-Y Plot from the Insert menu to create an xy plot.

  3. Type the name of the vector of x-values on the horizontal axis.

  4. Type the name of the vector of y-values on the vertical axis.

Note:

You can create a polar plot of vectors using similar steps. Simply insert the polar plot operator by choosing Graph / Polar Plot from the Insert menu and fill in the bottom and left placeholders.


Graphing More Than One Expression

You can graph several curves on one graph by typing a comma between the arguments on each axis. You can do this for either an XY or Polar Plot.

For example, follow the steps below to graph more than one expression on an XY plot:

  1. Choose Graph / XY Plot from the Insert menu to create a plot region.

  2. In the middle placeholder under the horizontal axis, enter the first expression or variable you want to plot.

  3. Type a comma. You’ll see a placeholder appear to the right.

  4. Enter the second expression or variable. You can continue adding expressions separated by commas up to a total of 10 expressions.

  5. In the middle placeholder beside the vertical axis, enter the first expression you want to plot.

  6. Type a comma and enter the second expression.

  7. You can continue adding expressions separated by commas; you must have the same number of expressions on each axis.

The expressions are matched in pairs. You see a trace for each pair. Each matching pair of expressions should use the same range variable, but the range variable for one pair need not match the range variables for the other pairs.

Example:

To create an XY plot of sin(x) and cos(y) versus x and y:

  1. Choose Graph / XY Plot from the Insert menu.

  2. In the middle placeholder under the horizontal axis, enter x.

  3. Type a comma. You’ll see a placeholder appear to the right.

  4. Enter y.

  5. In the middle placeholder beside the vertical axis, enter sin(x).

  6. Type a comma and enter cos(y).

You'll see:

Notes:

  • To graph several y-axis (or radial axis on a polar plot) expressions versus one x-axis (or angle axis on a polar plot) expression, enter one expression on the x-axis (or angle axis) and multiple expressions separated by commas on the y-axis (or radial axis). You can plot up to 16 y-axis arguments.


Graphing Uniform Polyhedra

Polyhedron(S1) Generates the uniform polyhedron whose name, number code, or Wythoff symbol is S1.

PolyLookup(n) Returns a vector containing the name, the dual name, and the Wythoff symbol for the polyhedron indicated by n.

Arguments:

S1 is a string.

S1 is the name of a polyhedron, its number code, or its Wythoff symbol.

n is the number code for a polyhedron, the name typed as a string, or the Wythoff symbol typed as a string.

Using Polyhedron:

To use the Polyhedron function to create a polyhedron:

  1. Click in a blank spot of your worksheet.

  2. Choose Graph / Surface Plot from the Insert menu.

  3. In the placeholder, type the Polyhedron function. The argument is either a name, the # sign followed by a number, or a Wythoff symbol. For example, type Polyhedron ("cube") or Polyhedron ("#6") or Polyhedron ("3|2 4")

  4. Click away from the graph.

Example using PolyLookup:

Launch QuickSheet Example


Graphs Available Through the Axum Component

2D graphs

Scatter

Line

Spline

Lowess

Weighted least squares

Bar

Error bar

Curve fit natural log

Curve fit exponential

Area

Histogram

Comment

3D graphs

Scatter

Line

Regression

Thin Surface

Spline

Other

Pie

Smith


Greater Than Operator

Keystroke: >

x > y

Returns 1 if x > y, 0 otherwise.

Operands:

  • x and y must be real or imaginary scalars, vectors, or strings.


Greater Than or Equal To Operator

Keystroke: Ctrl+0

x [image] y

Returns 1 if x [image] y, 0 otherwise.

Operands:

  • x and y must be real or imaginary scalars, vectors, or strings.


Greatest Common Divisor

gcd(A, B, C) Returns the greatest common divisor: the largest integer that evenly divides all the values A, B, C...

Arguments:

A, B, C, ... are each real, non-negative, dimensionless integers or an array whose elements are real, non-negative, dimensionless integers.

Examples:


Greek Toolbar

The Greek toolbar buttons allow you to insert Greek letters. To see the name of the Greek letter a button inserts, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Guess Values

When solving equations numerically, you must define values from which the solver should start its search for a solution.

To create a guess value, just define a variable. The variable name you use should match the variable arguments to the solving function.

Notes:

  • When using the root function, the root you converge to for expressions with multiple roots depends on the guess value.

  • When using the root, find, minerr, minimize, or maximize function, define a complex guess value if you expect a complex solution.


Handles on a Plot


Hanging Indent

A hanging indent, sometimes called an "outdent," occurs when the first line of a paragraph extends to the left of all the other lines in that paragraph.


Hard Page Breaks

A hard page break is a solid line across the worksheet. Everything below this line prints on a new page.

To insert a hard page break:

  1. Click where you want to put a page break. Make sure the line won't cut across any math or text regions.

  2. Choose Page Break from the Insert menu.

To delete a hard page break:

  1. Shift+Click a little to the right of the bend at far left where the line meets the left edge of the window.

  2. When you see a small dashed box beside the bend, choose Cut from the Edit menu.

Do not confuse hard page breaks with soft page breaks (dashed horizontal lines). Soft page breaks are determined by the printer you have chosen as the default printer for your operating system.


Harmonic Mean

Arguments:

  • A, B, C, ... are m x n arrays or scalars.

  • A, B, C, ... must be real and positive. For an array, the elements must be real and positive.

Notes:

  • The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals.

  • hmean(A, B, C, ...) < gmean(A, B, C, ...) < mean(A, B, C, ...

Other functions for data analysis...


Header and Footer Dialog Box

Click on either the Header or Footer tab in the dialog box to begin formatting the header or footer for your worksheet. Then use the following options to format your header or footer:

Left, Center, Right text boxes

Displays text or symbols indicating what will appear in your header or footer. To see exactly how the header or footer will look, choose Print Preview from the File menu. Click "Use full width for each section" if you want to specify long lines of text in the left, right, or center boxes.

Tools

Inserts the name of your worksheet. Displays as {f} in the Left, Center, and Right text boxes.

Inserts the path to your worksheet. Displays as {p} in the selected text box.

Inserts the page number. Displays as {n} in the selected text box.

Inserts the total number of pages in your worksheet. Displays as {nn} in the selected text box.

Inserts the date when your worksheet was last saved. Displays as {fd} in the selected text box.

Inserts the time when your worksheet was last saved. Displays as {ft} in the selected text box.

Inserts the current date. Displays as {d} in the selected text box.

Inserts the current time. Displays as {t} in the selected text box.

Format

Brings up a dialog box for specifying the font used in the header or footer.

Image

Allows you to insert a bitmap file. Displays as {image} in the selected text box.

Start at page number

Specifies the page number for the first page.

Different header and footer on first page

Displays two additional tabs in the dialog box. Use these tabs to format a different header or footer for the first page of the worksheet.

Page

Prints a border around each page.

Header

Prints a border around the header.

Footer

Prints a border around the footer.


Heaviside Step Function or Unit Step Function

(x) This returns 0 if x is negative, and 1 otherwise

Arguments:

  • x must be a real scalar.

Since this function is discontinuous at 0, you should not integrate expressions involving this function over an interval containing 0. Instead, divide the region of integration into two parts, integrate over each separately and add the result.

For the same reason, the derivative of this function is undefined at 0.

Launch QuickSheet Example


Help - About Mathcad

Shows the version number for your copy of Mathcad.


Help - Author's Reference

The Author's Reference is a separate Help resource that includes:

  1. Instructions to create E-books in Mathcad.
  2. Saving Mathcad files for the Web using MathML so the files can be read back into Mathcad.


Help - Developer's Reference

The Developer's Reference is a separate Help Resource that includes:

  • Customizing Mathsoft Control components,

  • Data Acquisition component,

  • Creating a user DLL,

  • Using Mathcad as a Automation server application, and

  • Building custom Mathcad components.


Help - Quicksheets

Opens the Resources window with a listing of sample worksheets demonstrating the usage of Custom Controls, Scriptable Object components, the automation interface, and user dlls.


Help - Mathcad Help

Opens a window containing an index, table of contents, and full text search feature for on-line help.


Help - Mathcad Update

Checks Mathcad.com for any applicable service releases. If one is found, Mathcad opens a browser window and points it to the download area. A login is required to access the download area of Mathcad.com.


Help - Mathcad.com

Launches the Resources window and brings you to the Mathcad web site, where you can check for service updates, browse the online library of Mathcad files, and talk with other Mathcad users.


Help - E-books - Open Book

Brings up the Open dialog box to open an Electronic Book. Use the dialog box to browse to an *.hbk file (an electronic book file).


Help - Reference Tables

Opens there Resources window with to a series of reference tables for physics, calculus, geometry, and other subjects.


Help - Tip of the Day

Brings up a dialog box showing a Tip of the Day. The Next Tip button allows you to go through each of the Tips of the Day that are available.

To prevent the Tip of the Day dialog box from appearing at startup, deselect Show Tips on Startup in the dialog box.


Help - Tutorials

Opens an overview of Mathcad in the Resources window, including an outline of new features and several introductory tutorials for new users.


Help - What's This?

Invokes Mathcad's context-sensitive Help system, allowing you to access help on a specific menu item or toolbar button.


Help Menu Commands

Mathcad Help

What's This?

Developer's Reference

Author's Reference

Tutorials

Quicksheets

Reference Tables

Tip of the Day...

E-books Þ Open Book...

User Forums

Mathcad.com

Mathcad Update...

About Mathcad...


Hermite Polynomial Function

Her(n,x) Returns the value of the Hermite polynomial of degree n at x.

Arguments:

n is a non-negative integer.

x is a real scalar.

The Hermite polynomial arises as a solution to the differential equation:


Hiding Component Arguments

To hide the input variables or output variables for a component:

  1. Click on the component with the right mouse button.

  2. Choose Hide Arguments from the pop-up menu.


Highlighting your Annotations in an E-book

By default, any changes you make to your Electronic Book appear in a different color.

To disable this feature:

  • Choose Highlight Changes from the Book menu.

This removes the checkmark from beside the menu command and displays the changes you've made in the regular text color.

To turn this feature back on:

  • Choose Highlight Changes from the Book menu.

This places a checkmark beside the menu and displays any changes you've made in a different color.


Hints on using the root function

The root function begins finding roots of a function by making successive approximations to the root value. If the magnitude of the function evaluated at the proposed root is less than the value of TOL, the root returns a result. Otherwise, an error is returned.

Here are some hints on getting the most out of the root function:

To change the accuracy of the root function, change the value of TOL. To find a more accurate root, decrease the value of TOL. If no root was found, try increasing the value of TOL.

If the expression has multiple roots, try different guess value or use the optional 3rd and 4th arguments on the root function to specify the interval in which the desired root lies.

For an expression f(x) with a known root a, solving for additional roots of f(x) is equivalent to solving for roots of h(x) = f(x) / (x-a). Dividing out known roots like this is useful for resolving two roots that may be close together. It’s often easier to solve for roots of h(x) as defined here than it is to try to find other roots for f(x) with different guesses.

You can use the root function when you want to find the root of an expression while varying one of the parameters. The simplest way to do this is to define a function in terms of the root function.

Launch QuickSheet Example


Histograms

hist(intvls,data) Returns a histogram of data - a vector representing the frequencies with which values in data fall into the intervals represented by intvls.

histogram(intvls,data) Returns a matrix with two columns. The first column contains midpoints of the n subintervals of the range min(A) £ value £ max(A) of equal length. The second column is identical to hist(n, A), and hence the resulting matrix has n rows. Using histogram rather than hist saves you the additional step of defining horizontal axis data when plotting.

Arguments:

intvls is either:

  • A vector of intervals which are real values in ascending order such that the ith element of the returned vector is the number of points of data falling between the ith and (i+1)th element of intvls.

  • An integer greater than zero indicating the number of subintervals of equal length.

data is an array of real data values.

Launch QuickSheet Example


Home Key Movement

In blank space...

Moves the crosshair beside the previous region. If the crosshair is already at the first region, this does nothing.

In math...

Moves the editing lines to the beginning of the expression. If the editing lines are already there, this does nothing.

In text...

Moves the text insertion point to the beginning of the line. If the insertion point is already there, this does nothing.


How to Get into Manual or Automatic Mode

Choose Calculate from the Tools menu.

  • When Automatic Calculation has a check next to it, calculations are in automatic mode.

  • When there is no check mark next to Automatic Calculation, calculations are in manual mode.


How to Tell When You're in Automatic Mode

When you're in automatic mode...

  • The word "auto" appears on the message line.

  • A check appears to the left of Automatic Calculation on the Tools menu.


How To Tell When You're in Manual Mode

When you're in manual mode...

  • The word "auto" will not be on the message line.

  • The word "calc" may be on the message line.

  • No check appears to the left of Automatic Calculation command on the Tools menu.


HTML Template

A template file specifies the HTML, Javascript, and other Web-browser-readable regions that can be used to wrap a Mathcad worksheet when it is saved as MathML. Template files are selected through the HTML Options tab on the Preferences menu, or through the second dialog from Save As Web Page.

A Web Template file is saved with a .mlt extension, and must include the following four sets of comment tags, in addition to whatever HTML markup you wish to appear in the final document. Between the the document <HEAD> tags:

<!-- #BeginEditable "Title" -->
<title>sample title goes here</title>
<!-- #EndEditable -->

<!-- #BeginEditable "MathMLheaders" -->
META tag information written here
<!-- #EndEditable -->

<!-- #BeginEditable "MathMLstyles" -->
Cascading styles written here
<!-- #EndEditable -->

Be sure to fill in a title between the title tags. This title is only overwritten when you specify a new title in the Save As Web Page dialog box. If you do not specify a new title, the template title tags will be used. Wherever you want the Mathcad worksheet to go in the template, place the following lines in the document <BODY> tags:

<!-- #BeginEditable "MathMLcontent" -->
HTML/MathML Content from Mathcad worksheet will be overwritten here
<!-- #EndEditable -->

Note that these templates are different from Mathcad Worksheet style templates.


Hyperbolic Cosine Integral


Hyperbolic Functions

sinh(z) | cosh(z)
tanh(z) | csch(z)
sech(z) | coth(z)

Arguments:

z must be in radians.

z must be a scalar.

z must be dimensionless.

Related Topics:

Arrays as arguments

Numerical issues

Relation to trig functions

Hyperbolic function definitions


Hyperbolic Functions Numerical Issues

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

Hyperbolic functions are subject to roundoff error in the following cases:

Large arguments

Small precision errors appear at very large arguments.

Singularities

Both cosh(x) and sinh(x) become unbounded when the argument goes to either + or - infinity.


Hyperbolic Sine Integral


Hypergeometric Distribution

Distributions related to the Hypergeometric Equation:

dhypergeom(m,a,b,n) Returns the probability density for the hypergeometric distribution.

phypergeom(m,a,b,n) Returns the cumulative probability distribution.

qhypergeom(p,a,b,n) Returns the inverse cumulative probability distribution.

rhypergeom(m,a,b,n) Returns a vector of m random numbers having the hypergeometric distribution.


Hyperlink (defined)

A hyperlink is a region or a group of selected text which, when double-clicked on, opens another worksheet or another file.

By default, bold underlined text indicates the presence of a link. If a region other than text is used to create the hyperlink, there will be no indication of the presence of a link. It is therefore recommended that you use selected text to create a hyperlink.


Hyperlinks from Non-text Regions

Although you can create hyperlinks from any region, there are two significant disadvantages to using something other than selected text as a gateway for a link.

  • When you create a link using text as the gateway, the worksheet automatically makes the font bold and underlined to indicate that a link exists there. No such indication is possible when you use a region other than selected text as the gateway.

  • The link preempts the normal response to double-clicking. For example, if you choose a plot as a gateway, you will no longer be able to double-click on that plot to open a formatting dialog box.

For these reasons, we recommend that you create hyperlinks using only selected text.


Hyperlinks to Other File Types

You can create a hyperlink not only to other worksheets, but also to any other file types such as AVI files. When you create a hyperlink to a file from another application, you do not have the option of displaying the file within a pop-up window.


Identity Matrix

identity(n) Returns an n x n identity matrix (a matrix of 0's with 1's along the diagonal).

Arguments:

  • n must be a positive integer.

Launch QuickSheet Example


if Function

Conditional Branching

if(cond, x, y) Returns x if logical condition cond is true (non-zero), y otherwise.

Arguments:

cond is usually an expression involving a logical/boolean operator. For example you can use:

(i < 2)

(x<1) [image] (x>0) or (x<1)*(x>0) for an “and” gate

(x>1) [image] (x<0) or (x>1)+(x<0) for an “or” gate

x=4 for an equality

x is the value returned when cond is true.

y is the value returned when cond is false.

Notes:

if is actually a Mathcad control operator, not a function, and will not work with operators that modify functions, like the vectorize operator.

Launch QuickSheet Example


Ignoring Definitions

Ordinarily, your worksheet will use any previous definitions it finds in your worksheet when you are using live symbolic keywords.

If you want to use live symbolics but ignore certain variable definitions in your worksheet, you can define the variables recursively. For example, if you have x:=10 in your worksheet, and you want to evaluate an expression involving x but assume x is undefined, type x:=x.

If you want to evaluate symbolically without using any previous definitions in your worksheet, you can evaluate an expression using commands from the Symbolics menu.


Illegal context

The most common causes of this error message are:

  • You entered a semicolon somewhere other than in a legal range definition. (The semicolon appears as two dots.)

  • You used a function name as a variable name or an existing variable name as a function name. For example, if f(x):=x then f +2 = gives the illegal context.

  • You created a definition that involves a range variable on the right side of the definition but the range variable does not appear on the left side. For example, if p:=0..4 then f:=p+2 gives an error. Instead define f(p):=p+2 or fp:=2.

  • You created a function definition involving a range variable. The range variable must be an argument to the function. For example:

    This example gives the illegal context error. However, if you include the range variable i as an argument to the function f, no error is issued:


Illegal dimensions.

This matrix does not have the rows or column you’re referring to. Type the matrix name and press the = sign to verify the number of rows and columns the matrix contains.


Illegal Function Syntax

The symbolic processor can't interpret an expression like (f)(x).


Image File Name

This is the name of the file containing the image.

If this file is located someplace other than the default directory you must type the full pathname to the file of interest.


Image Transformations

Once you've read the image into a matrix using READBMP or READRGB you can use all available math tools to modify that image. The examples below should give you some ideas:

Rotating an image...

Inverting an image...

Turning up the contrast...

Launch QuickSheet Example


Imaginary units

i or j

Keystroke: 1i or 1j

Description: The imaginary unit. Note that you must type 1i and 1j, not i and j. In either case, the extra '1' disappears when you leave the expression.

You can type multiples of i and j similarly, for example, 2i or -2.5j.


Importing a Picture from a File

You can insert graphics into your worksheet by referring to a file containing the graphics instead of by pasting from the clipboard. Importing from a file offers a number of advantages. The graphics formats allowed in a Picture region are BMP, GIF, JPG, PCX, and TGA.

To insert a graphic from an image file:

  1. Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

  2. Type the double quotes key (") to create a string. You will see an insertion point between double quotes.

  3. Type the name of the image pathname to the image file.

Once you import an image into your worksheet, you can make a number of adjustments to its appearance using the Picture toolbar and the Properties dialog box. You can also format it as you would any other region by putting a frame around it, highlighting it, or disabling its calculation.

Notes:

  • If you change the file on disk, you must click in the graphics region and choose Calculate from the Tools menu to update your worksheet.

  • Other ways to import a bitmap from a file are to read the file in as a matrix of data, or insert the file as an object.


Importing Data from a File (defined)

Importing Data from a File

To bring data from an external data file into a worksheet in a one-time fashion.


Incomplete Beta Function

ibeta(a,x,y) Returns the value of the incomplete beta function of x and y with parameter a.

Arguments:

a is a real scalar between 0 and 1 inclusive.

x and y are real scalars greater than zero.

The incomplete beta function arises often in probabilistic applications. It is defined by the following formula:


Indentation

There are two ways to set indentation: you can use the Paragraph Format dialog box, or you can use the text ruler.

To change indentation in a text region:

  1. Select text within the paragraph(s).

  2. Choose Paragraph from the Format menu.

  3. Use the options in the Paragraph Format dialog box to set indentation as follows:

  • To indent every line in the paragraph the same amount, enter a value in the Left or Right text boxes in the Indent section.

  • To indent the first line a different amount than the rest of the lines, choose First Line in the Special box and enter a value in the By text box.

  • To set a hanging indent, choose Hanging in the Special box and enter a value in the By text box.

  4. Click "OK."

To use the text ruler for setting indentation:

  1. Click on a paragraph in a text region.

  2. Choose Ruler from the View menu. The text ruler should now be displayed at the top of your window.

  3. To indent every line in the paragraph the same amount, move both arrows on the ruler to the same place.

  4. To indent the first line a different amount than the rest of the lines, move the top or the bottom arrow on the ruler.


Infinity

Keystroke: Ctrl+Shift+z

Description: When used in a numerical expression, this is set to

When used in symbolic calculations, this represents the usual mathematical definition of infinity.


Infix Notation

Infix notation is a way of displaying binary operators. In infix notation, the operator appears between the operands. For example:


In-line division operator

In-line Division

Keystroke: [ctrl] + /

x [image] y Returns x divided by y. If y=0, this returns an error message indicating there is a singularity If x is an array, the division operator divides each element by y.

Operands:

x and y are scalars.

y cannot be 0.

Note that the indeterminate form 0/0 always yields 0.


Inner Product Operator

Vector Inner Product

Keystroke: *

Returns the vector inner product (sometimes called a "dot product") of u and v.

Operands:

Both u and v are vectors having the same number of elements.

The inner product (or dot product) is a scalar formed by multiplying corresponding elements of u and v and summing the results. The inner product has the following properties:

=| u || v |cos(q) where q is the angle between u and v.

When u and v are orthogonal, their inner product is zero.

The inner product of u with itself is simply the square of the length of u.

Launch QuickSheet Example


Data Table Properties: Format

Displayed Precision

Choose or type an integer. Determines the number of values to the right of the decimal point.

Show trailing zeros

Click this to show trailing zeros for results with as many digits to the right of the decimal point as required by the current choice of Displayed Precision.

For example, if Displayed Precision = 3, then 3/2 displays as 1.5, if "Show trailing zeros" is unchecked, and 1.500 if "Show trailing zeros" is checked.

Radix

This is not available for the Data table.

Exponential threshold

Choose or type an integer n. Values smaller than 10^-n or greater than 10^n are displayed in exponential notation.

Complex threshold

Choose or type an integer. Controls how much larger the real or imaginary part of a number must be before display of the smaller part is suppressed.

For example, the number 1+0.002i would appear as follows when displayed with different complex threshold values.

Show row/column labels

Click this box to display the row and column numbers associated with the values in the table.

Font

Brings up a dialog box for controlling the font of the displayed numbers.


Input Variable

An input variable is a value(s) passed to another application or data source via a component. An input variable can be a single value, an array, or a string.

Note:

  • Strings and variables with units are allowed with certain components.


Insert - Area

Inserts area boundaries into your worksheet:

Place regions inside the boundaries and then lock or collapse the area.


Insert - Component

Brings up the Insert Component dialog box from the Insert menu. Choose a component to insert and click “OK.”

There are separate submenus on the Insert menu for commonly used components, Data and Control.

This menu option is available only when you click in a blank spot in the worksheet.


Insert - Control

Controls are components that allow you to control a Mathcad calculation using something other than a variable or function definition. Controls can be customized using a scripting language such as VBScript or JScript.

The following Windows-style Controls are available in Mathcad:

  • checkbox
  • radio button
  • push button
  • text box
  • list box
  • slider

Controls are assigned to the output of one or more variables, and can access the value of other variables in the Mathcad worksheet. See the Developer's Reference for more information.

Notes:

  • This menu option is available only when you click in a blank spot in the worksheet, not in a pre-existing placeholder.
  • All controls are also available via the Control toolbar.


Insert - Data

The Data menu pick under the Insert menu allows you to import or export data in one of three ways, and in a variety of formats.

  • File Input will insert a component into your worksheet that reads from data files in the following formats: ASCII text, MATLAB, Microsoft Excel, Lotus 1-2-3, Quattro Pro, dBase III, and S-PLUS. This component can be recalculated to read data again when the file has changed.
  • File Output will insert a component into your worksheet that writes to a data file in one of the following formats: ASCII text, MATLAB, Microsoft Excel, Lotus 1-2-3, Quattro Pro, dBase III, and S-PLUS. There are additional options for using tabs, commas, or spaces in text file output. This component can be recalculated to write data again when the data has changed.
  • Table will insert a component into your worksheet that reads from the same types of data files supported by the other data components. Data Tables read data only once; a link to the file is not maintained.

You can modify the number of rows or columns of data that are read, or, in the case of Excel worksheets, specify named ranges or cell ranges. You can change these settings either when the component is created, or by right-clicking on the component and choosing Properties... from the resulting menu.

Notes:

  • This menu option is available only when you click in a blank spot in the worksheet, not in a pre-existing placeholder.
  • Data file components creation buttons can be added to the Standard toolbar by right-clicking on the toolbar.
  • Data files may use only one type of delimiter. Using more than one type of delimiter in a data file may cause Mathcad to misread your data.


Insert - Function

Brings up the Insert Function dialog box with a scrolling list of built-in functions.

To see what a particular function does, click on the function name and read the text that appears in the box on the right.

To insert a built-in function, together with the necessary placeholders:

  1. Highlight the function name in the scrolling list of units.

  2. Click Insert.


Insert - Graph - 3D Bar Chart

Inserts the 3D plot operator with a placeholder into your worksheet. Create a three-dimensional bar chart of the elements in a matrix by entering the matrix into the placeholder. The rows and columns of the matrix correspond to x and y values. The values of the matrix elements themselves represent the heights of the bars above the xy plane.

If you want to specify the appearance of the plot (such as its color and lines) as it is inserted, choose Insert - Graph - 3D Plot Wizard instead.

Launch QuickSheet Example


Insert - Graph - 3D Plot Wizard

Brings up the 3D Plot Wizard which guides you through creating a three-dimensional plot such as a surface plot, a contour plot, a 3D bar chart, or a 3D scatter plot.


Insert - Graph - 3D Scatter Plot

Inserts the 3D plot operator into your worksheet. Create a scatter plot of an arbitrary collection of points in three dimensions by entering three vectors into the placeholder. The rows of the vectors represent the x, y and z coordinates of the points to plot.

You can also plot the elements of a matrix you enter in the placeholder. The rows and columns will correspond to the x and y axes. The value of the array element itself represents the height above the xy plane. No surface is drawn to connect the points.

If you want to specify the appearance of the plot (such as its color and lines) as it is inserted, choose Insert - Graph - 3D Plot Wizard instead.


Insert - Graph - Contour Plot

Inserts the 3D plot operator containing a placeholder into your worksheet. Create a contour plot of the elements of a matrix by entering the matrix into the placeholder. The rows and columns of the matrix correspond to the x and y axes. The values of the matrix elements themselves represent the contours above the xy plane.

If you want to specify the appearance of the plot (such as its color and lines) as it is inserted, choose Insert - Graph - 3D Plot Wizard instead.


Insert - Graph - Polar Plot

Inserts the polar plot operator containing placeholders for an angle variable and a radial expression. To quickly create a polar plot of a function, click on the placeholder on the left and enter the function expression.


Insert - Graph - Surface Plot

Inserts the 3D plot operator into your worksheet. Create a surface plot of the elements of a matrix by entering the matrix in the placeholder. The rows and columns of the matrix correspond to the x and y axes. The values of the matrix elements themselves represent the heights above the xy plane.

If you want to specify the appearance of the plot (such as its color and lines) as it is inserted, choose Insert - Graph - 3D Plot Wizard instead.


Insert - Graph - Vector Field Plot

Inserts the 3D plot operator with a placeholder into your worksheet. Create a two dimensional vector field plot by entering a matrix into the placeholder. The rows and columns of the matrix correspond to the x and y axes. The matrix elements themselves are complex numbers whose real and imaginary parts correspond to the x and y components of a vector associated with a particular value of x and y.

If you want to specify the appearance of the plot (such as its color and lines) as it is inserted, choose Insert - Graph - 3D Plot Wizard instead.

Launch QuickSheet Example


Insert - Graph - X-Y Plot

Inserts the X-Y plot operator containing placeholders for x and y values as well as endpoints of the axes. To quickly create an X-Y graph of a function, click on the middle placeholder on the y-axis and enter the function.


Insert - Hyperlink

Brings up the Insert Hyperlink dialog box allowing you to create, edit, or remove a hyperlink.

To use this command, you must first click on a region. A hyperlink is tied to the region so that when you double-click on it, another worksheet (located on a hard drive or on the Internet) opens in a full or pop-up window. With a region to region hyperlink, you jump directly to a specific region in the same worksheet or another worksheet.


Insert - Math Region

Creates a math region placeholder inside text. Type an expression, variable, function, or other math in the placeholder.

This command also creates a math region placeholder inside a blank part of your worksheet. It is not usually necessary, however, because you can insert math just by typing at the location of the crosshair in a blank part of the worksheet.

Math regions in text are live. They can affect and be affected by all other math regions in the worksheet. To disable a math region, use the Properties command in the Format menu.


Insert - Matrix

Brings up the Insert Matrix dialog box for creating a vector or matrix wherever the crosshair is located.

If the cursor is in a vector or matrix, choosing this allows you to insert or delete a row or column.


Insert - Object

Brings up dialog box with a list of OLE servers. Use this command to insert an OLE object into your worksheet. You can create a new object or insert one from an existing file. Choose Display as Icon to display an icon in place of the object in your worksheet.


Insert - Page Break

Inserts a page break wherever the cursor is located.

To delete a page break, click where the line indicating the page break touches the left edge of your worksheet. Then choose Cut from the Edit menu.


Insert - Picture

Inserts the picture operator containing a placeholder. Insert an image in one of three ways:

  • By typing a string containing the name of or path to an image file in the placeholder.

  • By typing the name of a matrix into the placeholder. This will show the matrix in up to 256 shades of gray.

  • By typing into the placeholder the names, separated by commas, of three matrices of the same size, containing the individual red, green, and blue values corresponding to a color image. This will display an RGB rendering of the image. You can also display HSV (hue, saturation, and value) and HLS (hue, lightness, and saturation) renderings if your matrices correspond to these color mappings.


Insert - Reference

Lets you save space in your worksheet by making all variable and function definitions from another worksheet available in your current worksheet.

Brings up the Insert Reference dialog box for you to specify the file to be referenced. Use the “Browse” button to locate a select a worksheet or type the complete pathname or URL then click “OK.” Upon doing so, you'll see an icon marking the spot after which the included definitions will be available.

This command inserts the worksheet reference wherever the cursor is located. To delete a reference to a worksheet, select the icon and choose Delete from the Edit menu.


Insert - Text Region

Creates a region of text wherever the crosshair is. The crosshair changes into a thin vertical line. A box appears showing the extent of the text region. This box disappears when you click outside the region.

You can change the width of a text region by selecting it and dragging on the right edge of the selection rectangle with the mouse.


Insert - Unit

Brings up the Insert Unit dialog box with a scrolling list of built-in units.

To express a result in terms of a built-in unit:

  • Click on the unit placeholder to the right of a result.

  • Highlight the unit in the scrolling list of units.

  • Click Insert to insert the unit.


Insert Function Dialog Box

The Insert Function dialog box has the following options:

Function Category

Displays a list of categories of built-in functions. Choose "All" to see all the functions.

The categories can change depending on whether you’ve installed additional extension packs or whether you’ve written your own built-in functions.

Function Name

Displays a list of built-in functions in the selected category.

Syntax

Shows the kind and number of arguments required for the selected function.

Description

Displays a description of the selected function.

Insert button

Inserts the selected function (together with placeholders for its arguments) into your worksheet.

To apply a function to an expression you have already entered, surround the expression with the editing lines and then click this button.

OK button

Inserts the selected function (together with placeholders for its arguments) into your worksheet and closed the dialog box.

Help button

Brings up information from the on-line Help regarding the selected function.


Insert Hyperlink Dialog Box

The Insert Hyperlink dialog box has the following options:

Link to file or URL

Enter the path to a local or remote file that should open up when you double-click on the hyperlink. For example, enter a path such as:

c:\windows\file.mcd or http://www.mathsoft.com/text.swk

Once the worksheet has been linked to, do not rename it or move elsewhere. If you do, the link will not know where to find it. If you plan to move the worksheet containing the link as well as the linked worksheet, make sure you keep the relative directory structure between the two and make sure the link uses a relative path.

Use relative path for hyperlink

Stores the location of the linked file relative to the worksheet containing the link. Allows the link to be valid even if you move the liked file and the main worksheet, but keep the relative directory structure between the two the same.

To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, the path may display as a full path but the worksheet uses a relative path internally. If you move the files, the displayed path will change accordingly.

Display as pop-up document

Specifies that the linked worksheet should open in its own pop-up window.

Message that appears on status line when mouse is over link

This message appears on the status bar when the mouse is over the hyperlink.

Remove Link

Deactivates the hyperlink associated with the selection. Once you click this, double-clicking on the selection will no longer cause a jump or pop-up to another worksheet.


Insert Matrix Dialog Box

The Insert Matrix dialog box has the following options:

Rows

Enter the number of rows to insert or create.

Columns

Enter the number of columns to insert or create.

Insert

Inserts a matrix of placeholders.

  • If you insert rows to an already existing matrix, the worksheet creates rows of empty placeholders below the selected element.

  • If you insert columns to an already existing matrix, the worksheet creates columns of empty placeholders to the right of the selected element.

If this button is gray, make sure you have filled in the “Rows:” and “Columns:” boxes with the number of rows and columns you would like your new matrix to have. Also make sure that your cursor is on a placeholder or in a blank spot of your worksheet.

Delete

Deletes rows and/or columns from a matrix:

  • If you delete rows, the worksheet begins with the row occupied by the selected element and deletes rows from that element downward.

  • If you delete columns, the worksheet begins with the column occupied by the selected element and deletes columns from that element rightward.


Insert Menu Commands

Graph / X-Y Plot

Graph / Polar Plot

Graph / 3D Plot Wizard...

Graph / Surface Plot

Graph / Contour Plot

Graph / 3D Scatter Plot

Graph / 3D Bar Plot

Graph / Vector Field Plot

Matrix...

Function...

Unit...

Picture

Area

Page Break

Math Region

Text Region

Component

Data

Control

Object...

Reference...

Hyperlink...


Insert Object Dialog Box

The Insert Object dialog box has the following options:

Create New

Lets you insert a graphic stored in a file you’ve already created.

Create from File

Lets you insert a graphic stored in a file you’ve already created.

File or Object Type

When Create New is selected, lists the available applications in which to create a new object. When Create from File is selected, allows you enter a file name.

Browse

Locates a stored file.

Link

Links an object from an OLE server into your worksheet. When you make changes to a linked graphic, you change both the copy in Mathcad as well as the original. Create from File must be selected for this option to be available.

Display as Icon

Displays the object as an icon.


Insert Reference Dialog Box

The Insert Reference dialog box has the following options:

Insert reference to file

Enter the name of a file to reference. This must be a worksheet that already exists, either on your drive or on the Internet. For example, to reference a file CONFORM.MCD located in the Mathsoft folder, you could type:

c:\program files\mathsoft\conform.mcd

Or, to insert a reference to a file located on the World Wide Web, you could type:

http://www.mathsoft.com/coeffs.mcd

Use relative path for reference

Stores the location of the reference file relative to the worksheet containing the reference. Allows the reference to be valid even if you move the referenced file and the main worksheet, but keep the relative directory structure between the two the same.

To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, the path may display as a full path but a relative path is used internally. If you move the files, the displayed path will change accordingly.


Insert Unit Dialog Box

The Insert Unit dialog box has the following options:

Dimension

Use this to control the units displayed in the Unit list. This confines the list of displayed units to those having the appropriate dimensions. To show the complete list of units, scroll to the top of the list and choose Dimensionless.

If you click on a numerical result, this will automatically be set to whatever dimension is appropriate for that result.

System

Shows the default system of units. To change the system of units, choose Worksheet Options from the Tools menu and click on the Unit System tab.

Unit

Displays a list of units available for the dimension selected in the Dimension section. To show the complete list of units, scroll to the top of the list in the left-hand box and choose "Dimensionless" from the top of that list.

Double-clicking on a unit inserts it into your worksheet.

Insert

Inserts the selected unit into your worksheet.


Inserting a Blank Line

To insert a blank line...

  1. Click in a blank space above which you want to insert a blank line. You should see the crosshair.

  2. Press Enter as many times as there are blank lines you want to insert.

You can also insert a number of blank lines by clicking in a blank space and then right click to display a pop-up dialog. Choose Insert Lines then enter the number of lines to insert.


Inserting a Graphics Object

To insert a new graphic into your worksheet as an object:

  1. Choose Object from the Insert menu to bring up the Insert Object dialog box.

  2. Select an application in which to create it and click “OK.”

  3. The graphic will be an embedded object.

To insert a graphic stored in an existing file:

  1. Choose Object from the Insert menu to bring up the Insert Object dialog box.

  2. Click “Create from File” and set the path to the file containing the graphic.

  3. Click “Link” to create a linked object. Otherwise, the object is embedded.


Inserting Columns

To insert one or more columns in a matrix:

  1. Click on an element in the first column you want to delete.

  2. Choose Matrix from the Insert menu to bring up a dialog box.

  3. Specify the number of columns to insert.

  4. Click the "Insert" button.

You'll see one or more columns of empty placeholders to the right of the column containing the selected element.


Inserting Greek Letters

To insert a Greek letter:

  1. Type the roman equivalent from the chart below.

  2. Make sure the insertion point is directly to the right of the letter you want to turn into a Greek letter.

  3. Type Ctrl+G.

Ctrl+G toggles between Greek and roman letters. If you place the insertion point directly to the right of a Greek letter and press Ctrl+G, the Greek letter will turn into an equivalent roman letter.


Inserting Mathcad or Excel objects

If you want Excel calculations or tables to appear in your Mathcad worksheet, you can:

  • Insert an object using menu commands. Follow the instructions for inserting a graphics object.

  • Insert an Excel Component using menu commands. Follow the instructions for inserting a component. You could also use a Data File Input component to read Excel content.

  • Copy and paste. Follow the instructions for importing a graphics image from the clipboard or .

  • Drag and drop. Follow the instructions for importing graphics by dragging and dropping.

If you want Mathcad calculations or graphs to appear in an Excel worksheet, you can:

  • Insert an object using menu commands. Choose Object from the Insert menu in Excel and select Mathcad from the list of applications.

  • Copy and paste. Select Mathcad regions then go into Excel and choose Paste from the Edit menu.

  • Drag and drop. Select Mathcad regions then follow the instructions for importing graphics by dragging and dropping.


Inserting Rows

To insert one or more rows in a vector or matrix:

  1. Click on an element in the row below which you want to add additional rows.

  2. Choose Matrix from the Insert menu to bring up a dialog box.

  3. Specify the number of rows to insert.

  4. Click the "Insert" button.

You'll see one or more rows of empty placeholders below the row containing the selected element.


Insertion Point

The insertion location of characters or symbols you type on the worksheet is marked by a vertical line. Insertion is to the left of the vertical line. Use [image] and [image] keys to move it. Or click the mouse at the cursor location to define a new insertion point.


This integer is too large.

This value is too large to work with. If you’re using a built-in function, click on the function name and press F1 for additional information.


This integer is too small.

This value is too small to work with. If you’re using a built-in function, click on the function name and press F1 for additional information.


Integrating Mathcad and Excel

Integrating Excel into a Mathcad worksheet

If you want to use Excel functionality while in Mathcad, you can use the Excel component in your Mathcad worksheet. The Excel component allows you to exchange data with and access the features of Microsoft Excel if it is installed on your system. For information, follow the instructions on using the Excel component.

Integrating Mathcad into an Excel worksheet

If you want to use Mathcad's functionality while in Excel, you can use Mathcad as an OLE automation server. To do so, you must write a program in Excel using Visual Basic 5.0 or higher. You use the program to define and retrieve variables in Mathcad Document objects. This allows you to:

  1. Send data dynamically to Mathcad from Excel.

  2. Use Mathcad to perform calculations or other data manipulations.

  3. Send results back to Excel.


Integration operator

Definite Integral

Keystroke: &

Returns the definite integral of f(x) from a to b.

Operands:

  • f is any scalar valued function defined in the closed interval [a,b].

  • x is the variable of integration.

  • a and b must be real scalars, but f may be complex valued.

  • a and b must be have the same dimensions if any.

Example:

Although the example shows a function of one variable, f can be a function of any number of variables.

To evaluate double or multiple integrals, press & more than once.

Notes on integration:

By default, the integral operator is evaluated numerically using AutoSelect. AutoSelect chooses the algorithm most appropriate for the integral. If you want to see what answer another algorithm yields, override AutoSelect and choose an algorithm yourself.

See: Symbolic integration.


Intellimath

IntelliMath features in Mathcad help you speed through common tasks and routine operations. IntelliMath features include:

  • Mathcad’s AutoSelect feature for solving and for integrating which analyzes your problem and selects the best-solution algorithm.

  • Optimization which lets Mathcad’s built-in numeric and symbolic processors work together to find the best solution to your problem.

  • Mathcad's ability to automatically track and convert units as you work.


Interest Rate

rate(nper, pmt, pv, [[fv], [type], [guess]]) Returns the interest rate per period of an investment or loan over a specified number of compounding periods given a periodic, constant payment and a specified present value.

Arguments:

nper is the total number of compounding periods per year. nper is a positive integer.

pmt is the payment made each period. It usually includes principal and interest but no other taxes and fees.

pv is the present value of the investment.

fv (optional) is the future value of the investment. If omitted, fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

guess (optional) is a numeric value which you guess approximates the answer. If omitted, guess = 0.01 (10%).

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.

  • If rate cannot find a result that is accurate to within 1*10-7 percent after 20 iterations an error is returned. If this happens, try a different guess value.

Example:

To calculate the monthly interest rate for a five-year $8,000 loan with monthly payments of $150 type:

rate((12*5), -150, 8000) = 0.395 %


Interest Rate Per Period

crate(nper, pv, fv) Returns the fixed interest rate per period required for an investment at present value to yield a specified future value over a number of compounding periods.

Arguments:

nper is the number of compounding periods. nper must be an integer. nper [image] 1.

pv is the present value of the investment. pv [image] 0.

fv is the future value of the investment. fv > 0.


Internal Rate of Return

irr(v, [guess]) Returns the internal rate of return for a series of cash flows occurring at regular intervals.

Arguments:

v is a vector of cash flows assigned at regular intervals. There must be at least one positive and one negative number in v.

guess (optional) is a numeric value which you guess approximates the answer. If omitted guess = 0.1 (10%).

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.

  • If irr cannot find a result that is accurate to within 1*10-5 percent after 20 iterations an error is returned. If this happens try a different guess.

Example:

If you start a business which you estimate will cost $50,000 to start and expect to net the following income in the first five years: $13,000, $14,000, $15,000, $18,000, and $20,000. To calculate the internal rate of return after five years:


Interp Function

The interp function is used in several different applications:

Cubic spline interpolation

Multivariate cubic spline interpolation

Polynomial regression

Multivariate polynomial regression


Interpolation

To find the value for a particular x, the worksheet finds the two points between which the value falls and returns the corresponding y value on the cubic section between the two points.

For x values before the first known data point, the worksheet extrapolates the cubic section between the first two data points.

For x values beyond the last known data point, the worksheet extrapolates the cubic section between the last two data points.


Interpolation and Prediction Functions

linterp(vx, vy, x)

Interpolated value at x when points in vx and vy are connected with straight lines.

lspline(vx, vy)

Cubic spline interpolation with linear end conditions. Returns vs vector for use with interp function below.

pspline(vx, vy)

Cubic spline interpolation with parabolic end conditions. Returns vs vector for use with interp function below.

cspline(vx, vy)

Cubic spline interpolation with cubic end conditions. Returns vs vector for use with interp function below.

interp(vs, vx, vy, x)

Returns interpolated value of x using spline interpolation. vs is the vector returned by lspline, pspline, cspline, or bspline.


Interrupting a Calculation

To interrupt a calculation:

  • Press Esc.

You'll see an error message pointing at whichever equation was interrupted.

To resume calculation:

  • Choose Calculate from the Tools menu.


Invalid Arguments

The symbolic processor can't carry out the requested operation for the given arguments. You'll see this, for example, if you apply a scalar function to an array without using the vectorize operator and choose Simplify from the Symbolics menu.


Invalid expansion point

You can’t expand the expression around the point you’ve specified. Make sure you’re using the series keyword for symbolic expansion correctly.


Invalid matrix dimension...

Invalid matrix dimension. The number of rows is less than the number of columns.

The svd function requires that the argument be an m x n array, where m [image] n.


Invalid Range

In looking for a numerical solution to an equation, the symbolic processor tried to evaluate one of its built-in functions at a point outside its domain.


Inverse Cumulative Probability Distribution

These functions take a probability as an argument and return a value such that the probability that a random variable will be less than or equal to that value is whatever probability you supplied as an argument.


Inverse FFT of Complex Data (icfft function)

Inverse FFT of Complex Data

icfft(A) Returns the inverse Fourier transform corresponding to cfft, again normalized by 1/sqrt(N).

ICFFT(A) Returns the inverse Fourier transform corresponding to CFFT.

Arguments:

A can be a vector or a matrix.


Inverse Fourier Transform

To evaluate the inverse Fourier transform of a function:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform / Inverse Fourier from the Symbolics menu.

Mathcad returns a function the variable t when you perform an inverse Fourier transform. If the expression you are transforming already contains a t Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute for Variable command to substitute a different variable or expression for t.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not "know" about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "invfourier" keyword with live symbolic evaluation.

Launch QuickSheet Example


Inverse FFT of Real Data (ifft Function)

Inverse FFT of Real Data

ifft(u) Returns the inverse Fourier transform corresponding to fft. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

IFFT(u) Returns the inverse Fourier transform corresponding to FFT. The result is a [image] element vector whose kth element is given by:

Arguments:

  • u is a vector with [image] elements (m>2).

Notes:

  • Use this only when the original data was purely real. If the original data was complex, use icfft/ICFFT instead.

  • This function uses a highly efficient fast Fourier transform algorithm. In order to do so, the vector you use with ifft must have [image] elements. For vectors with complex values or with any number of elements, use icfft instead.

  • For 2 dimensional Fourier transforms, use icfft instead.

  • If you use fft to get to the frequency domain, you must use ifft to get back to the time domain.

Launch QuickSheet Example


Inverse Hyperbolic Functions

asinh(z) acoth(z)

acosh(z) acsch(z)

atanh(z) asech(z)

Arguments:

z must be a scalar.

z must be dimensionless

Values returned are from the principal branch of these functions.


Inverse Laplace Transform

To evaluate the inverse Laplace transform of a function:

  • Enter the expression to be transformed.

  • Click on the transform variable.

  • Choose Transform / Inverse Laplace from the Symbolics menu.

Mathcad returns a function in the variable t when you perform an inverse Laplace transform. If the expression you are transforming already contains a t, Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute for Variable command to substitute a different variable or expression for t.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not "know" about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "invlaplace" keyword with live symbolic evaluation.

Launch QuickSheet Example


Inverse operator

Inverse

Keystroke: 1/

This returns the inverse of x. If x=0, this returns an error message indicating there is a singularity.

Operand:

x cannot be 0.


Inverse Trigonometric Functions

asin(z) acsc(z)

acos(z) asec(z)

atan(z) acot(z)

atan2(x,y)

Arguments:

z must be a scalar.

z must be dimensionless.

x and y are scalars.

Notes:

  • Values returned are in radians.

  • atan2(x,y) takes only real arguments and returns the angle (in radians between -pi and pi, excluding -pi) from the x-axis to a line containing the origin (0,0) and the point (x,y).

  • Values returned are from the principal branch of these functions.


Inverse Trigonometric Functions

These functions can be calculated by taking the reciprocals and using the built-in functions ACOS, ASIN, etc.

For example, you can define

ARCSEC(x) := ASEC(1/X)


Inverse Z-transform

To evaluate the inverse z-transform transform of a function:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform / Inverse z from the Symbolics menu.

Mathcad returns a function in the variable n when you perform an inverse z-transform. If the expression you are transforming already contains an n, Mathcad avoids ambiguity by returning a function in the variable nn instead. Use the Variable / Substitute command to substitute a different variable or expression for n.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not "know" about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "invztrans" keyword with live symbolic evaluation.

Launch QuickSheet Example


Inverting an Image


Isarray Function

IsArray(x) Returns 1 if x is a matrix or vector. Returns 0 otherwise.

Arguments:

x is any value, array, or string.

Example:

This function is most useful inside a conditional statement of a program.


IsScalar Function

IsScalar(x) Returns 1 if x is a real or complex scalar. Returns 0 otherwise.

Arguments:

x is any value, array, or string.

Example:

This function is most useful inside a conditional statement of a program.


IsString Function

IsString(x) Returns 1 if x is a string. Returns 0 otherwise.

Arguments:

x is any value, array, or string.

Example:

This function is most useful inside a conditional statement of a program.


Iteration does NOT Converge to a Solution

The integrand may have a singularity or the integral may not be finite.

Results involving integrals, derivatives, the root, find, or minerr functions require iteration. If after many iterations successive estimates still differ by more than the required tolerance, you'll see this error message.

Try setting TOL to be larger. If you're working with the root, find, or minerr functions try a different guess value as well.


Iteration Over a Range of Values

Any calculation you can perform once, you can perform over a range of values. For example, suppose you want to create a list of x and y values for points on the polar curve r=cos(q) + 1. The basic idea is as follows:

  • q should take on values between 0 and 2p. Define q as a range variable or as a vector.

  • For each q, the corresponding r is given by r=cos(q) + 1.

  • For each r and q, there is a corresponding x and y given by x=r*cos(q) and y=r*sin(q).

This can be done using functions or by defining vectors.

Using functions: | Using vectors:


Jacobi Polynomial Function

Jac(n,a,b,x) Returns the value of the Jacobi polynomial of degree n at x with parameters a and b.

Arguments:

n is a non-negative integer.

a and b are real scalars greater than -1.

x is a real scalar.

The Jacobi polynomial arises as a solution to the differential equation:

Note that the Chebyshev and Legendre polynomials are special cases of the Jacobi polynomials.


Joining Arrays

augment(A, B, C, ...) Returns an array formed by placing A, B, C, ... left to right.

stack(A, B, C, ...) Returns an array formed by placing A, B, C, ... top to bottom.

Arguments:

A, B, C, ... can all be arrays having the same number of rows for augment or the same number of columns for stack.

A, B, C, ... can be scalars and single-row arrays for augment or scalars and single-column arrays for stack.


Jscript

Microsoft JScript is a fast, portable, lightweight interpreter for use in applications that use ActiveX Controls, OLE automation servers, and Java applets. JScript is directly comparable to VBScript (not Java). Like VBScript, JScript is a pure interpreter that processes source code rather than producing stand-alone applets.


Keyword "assume"

To evaluate an expression based on certain assumptions, use the assume keyword.

  • If you want to assume a variable is real, follow the keyword with var=real, where var is the variable.

  • If you want to assume a variable is real between the real numbers a and b, follow the keyword with var=RealRange(a,b), where var is the variable.

Other keywords...


Keyword "coeffs"

To find the coefficients of a polynomial, use the coeffs keyword:

  1. Type the expression whose coefficients you want to find.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword coeffs.

  4. Type a comma followed by the variable or function in which you want your expression to be regarded as a polynomial.

  5. Press Enter to see the result.

Other keywords...

Launch QuickSheet Example


Keyword "collect"

To simplify an expression by representing a sum of terms as a polynomial in a particular variable:

  1. Type the expression you want to simplify.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword collect.

  4. Type a comma followed by the variable or expression on which to collect.

  5. Press Enter.

This will rewrite the sum as a polynomial in that variable or function.

Launch QuickSheet Example

Other keywords...


Keyword "complex"

Ordinarily, the symbolic processor returns symbolic results in as simple a form as possible. Sometimes, particularly when working with complex numbers, it is more convenient to see results separated into real and imaginary parts. Use the keyword complex to see results in this form (a+i*b) whenever possible.

Launch QuickSheet Example

Other keywords...


Keyword "convert"

To convert an equation to a partial fraction, use the convert keyword with parfrac:

  1. Type the expression you want to convert.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type convert,parfrac.

  4. Type a comma followed by the variable in the denominator of the expression on which to convert.

  5. Press Enter to see the result.

Other keywords...

Launch QuickSheet Example


Keyword "expand"

Use the expand keyword to expand all powers and products of sums in the selected expression. To expand an expression in a particular variable, follow the expand keyword with a comma and the variable.

You can also expand an expression using the Expand command on the Symbolics menu.

Launch QuickSheet Example

Other keywords...


Keyword "factor"

Use the keyword factor to transform an expression into a product. This will transform:

  • a polynomial into a product of polynomials

  • an integer into a product of primes

  • a sum of rational expressions into a single fraction

To factor on a radical, follow the keyword factor with a comma and a radical or several radicals separated by commas.

Launch QuickSheet Example

Other keywords...


Keyword "float"

Use the float keyword to return a floating point number rather than a symbolic result whenever possible.

To specify how many digits of precision to display, follow the float keyword with an integer.

Launch QuickSheet Example

Other keywords...


Keyword "fourier"

Use the keyword fourier to evaluate the inverse z-transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword fourier.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The fourier keyword returns a function in the variable w. If the expression you are transforming already contains a w, the symbolic processor avoids ambiguity by returning a function in the variable ww instead. Use the Substitute keyword to substitute a different variable or expression for w.

Launch QuickSheet Example

Other keywords...


Keyword "invfourier"

Use the keyword invfourier to evaluate the inverse z-transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword invfourier.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The invfourier keyword returns a function of the variable t. If the expression you are transforming already contains a t Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute keyword to substitute a different variable or expression for t.

Launch QuickSheet Example

Other keywords...


Keyword "invlaplace"

Use the keyword invlaplace to evaluate the inverse laplace transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword invlaplace.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The invlaplace keyword returns a function in the variable t. If the expression you are transforming already contains a t, Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute keyword to substitute a different variable or expression for t.

Launch QuickSheet Example

Other keywords...


Keyword "invztrans"

Use the keyword invztrans to evaluate the inverse z-transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword invztrans.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The invztrans keyword returns a function in the variable n. If the expression you are transforming already contains an n, Mathcad avoids ambiguity by returning a function in the variable nn instead. Use the Substitute keyword to substitute a different variable or expression for n.

Launch QuickSheet Example

Other keywords...


Keyword "laplace"

Use the keyword laplace to evaluate the Laplace transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword laplace.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The laplace keyword returns a function in the variable s. If the expression you are transforming already contains an s, the symbolic processor avoids ambiguity by returning a function in the variable ss instead. Use the Substitute keyword to substitute a different variable or expression for s.

Launch QuickSheet Example

Other keywords...


Keyword "series"

Use the series keyword followed by a variable to expand an expression when that variable is set to zero.

The series keyword finds Taylor series (series in nonnegative powers of the variable) for functions that are analytic at 0, and Laurent series for functions that have a pole of finite order at 0To expand about a point other than zero, use the logical equals.

For example:

x+y series,x=2

expands around the point x=2.

Notes:

  • The series keyword generates a series of order 6. To specify a different order of expansion, follow the variable of expansion with a comma and an appropriate integer. The order is the order of the error term in the expansion. For example, if the symbolic processor expands sin(x) to a series in x, it returns an expansion of the sine function in powers of x in which the highest power is x5. The error is thus O(x6).

  • To expand a series around more than one variable, follow the series keyword with a comma and the variables, separated from each other by commas.

  • In using the approximations you get from the symbolic processor, the Taylor series for a function may converge only in some small interval around the center. Furthermore, functions like sin or exp have series with infinitely many terms, while the polynomials returned in your worksheet have only a few terms (how many depends on the order you select). Thus, when you approximate a function by the polynomial returned, the approximation is reasonably accurate close to the center, but may be quite inaccurate for values far from the center.

  • Another way to generate a series expansion is to enter the expression and click on a variable for which you want to find a series expansion. Then choose Variable / Expand to Series from the Symbolics menu. A dialog box prompts you for the order of the series. This command is limited to a series in a single variable; any other variables in the expression are treated as constants. The results also contain the error term using the O notation. Before you use the series for further calculations, delete this error term.

Launch QuickSheet Example

Other keywords...


Keyword "simplify"

Use the simplify keyword to carry out basic algebraic simplification and to apply trigonometric and inverse function identities.

  • To simplify an expression assuming indeterminants are real, follow the keyword simplify with assume=real.

  • To simplify an expression assuming indeterminants are real and between the values a and b, follow the keyword simplify with assume=RealRange(a,b) where a and b are real numbers or infinity.

  • To simplify a trigonometric expression by applying only the following identities:

follow the keyword simplify with trig.

You can also simplify a result using the Simplify command on the Symbolics menu.

Launch QuickSheet Example

Other keywords...


Keyword "solve"

To solve an equation symbolically for a variable, use the solve keyword:

  1. Type the equation. Use Ctrl+Equals for the equal sign.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword solve.

  4. Type a comma followed by the variable for which to solve.

  5. Press Enter to see the result.

To solve a system of equations symbolically:

  1. Create a vector having n rows and 1 column and fill in the element placeholders with the equations in the system. Use Ctrl+Equals for the equal sign.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword solve.

  4. Create a vector having n rows and 1 column and fill in the element placeholders with the variables to solve for.

  5. Press Enter to see the result.

Other keywords...


Keyword "substitute"

To replace all occurrences of a variable with another variable, an expression or a number:

  1. Type the expression containing the variable to be replaced.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword substitute.

  4. Type a comma followed by an equation of the form var1=var2, where var1 is to be replaced by var2. Use Ctrl+Equals for the equal sign.

  5. Press Enter to see the result.

This operation can sometimes result in an unwieldy expression. To simplify the result, apply the keyword simplify.

Note that this command only works for replacing a variable with an expression. You cannot use this keyword to replace one expression with another. To replace one expression with another, use the Cut and Paste commands on the Edit menu.

Launch QuickSheet Example

Other keywords...


Keyword "ztrans"

Use the keyword ztrans to evaluate the z-transform of a function:

  1. Type the function you want to evaluate.

  2. Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

  3. Type the keyword ztrans.

  4. Type a comma followed by the variable in which the transform should be made.

  5. Press Enter.

The ztrans keyword returns a function in the variable z. If the expression you are transforming already contains a z, the symbolic processor avoids ambiguity by returning a function in the variable zz instead. Use the Substitute keyword to substitute a different variable or expression for z.

Launch QuickSheet Example

Other keywords...


Keywords

assume

coeffs

collect

complex

convert

expand

factor

float

fourier

invfourier

invlaplace

invztrans

laplace

series

simplify

solve

substitute

ztrans


Knots

The "knots" used in B-spline interpolation are those values where the individual polynomials fit together. This is unlike other splines where the knots are forced to be the x values.


Kronecker delta function

(m,n) Returns 1 if m = n. It returns 0 otherwise

Arguments:

Both m and n must be integers without units.

Since this function is discontinuous at 0, you should not integrate expressions involving this function over an interval containing 0. Instead, divide the region of integration into two parts, integrate over each separately and add the result.

For the same reason, the derivative of this function is undefined at 0.


The ksmooth Function

The ksmooth function uses a gaussian kernel to compute local weighted averages of the input vector vy. For each element in the n-element vector vy, the ksmooth function returns a new vy element given by:

and b is a bandwidth which you supply to the ksmooth function. The bandwidth is usually set to a few times the spacing between data point on the x axis depending on how big a window you want to use when smoothing.


Kurtosis Function

Kurtosis

Arguments:

A, B, C, ... are arrays or scalars. An array M created from the function arguments must have at least four elements.

The standard deviation of M, an array created from the function arguments, must not equal zero.

Notes:

  • The kurtosis of a set of values indicates how flat or peaked the distribution is when compared to the normal distribution. kurt(M)>0 indicates a relatively peaked distribution. kurt(M)<0 indicates a relatively flat distribution.

  • kurt(M)=0 for the normal distribution.

Other functions for data analysis...


Labeling Axes on an X-Y Plot

To label an axis of a plot:

  1. Double-click on the plot or choose Graph / XY Plot from the Format menu to open a tabbed dialog box.

  2. Click on the Labels tab.

  3. In this dialog box, type in a label for either or both axes. You can use upper and lower case letters in the label.

  4. Click "OK" to display the labels you've specified.

To remove the label from the text boxes, click on "Cancel" to restore the label text boxes to their original state.

To delete the labels altogether, backspace over them.


Labels Page for Polar Plots

The Formatting Currently Selected Polar Plot dialog box has the following options on the Labels tab:

Title

Enter a title for the plot.

Above

Makes the title appears above the plot when "Show Title" is checked.

Below

Makes the title appears below the plot when "Show Title" is checked.

Show Title

Check this to display the title entered in the Title text box.


Labels Page for X-Y Plots

The Formatting Currently Selected X-Y Plot dialog box has the following options on the Labels tab:

Title

Enter a title for the plot.

Above

Makes the title appears above the plot when "Show Title" is checked.

Below

Makes the title appears below the plot when "Show Title" is checked.

Show Title

Check this to display the title entered in the Title text box.

Axis Labels

Enter the text you want to have appear beside the axis in the corresponding text box. Make sure the check box beside it is checked. Uncheck this box to suppress the display of the axis label.


Laguerre Polynomial Function

Lag(n,x) Returns the value of the Laguerre polynomial of degree n at x.

Arguments:

n is a non-negative integer.

x is a real scalar.

The Laguerre polynomial arises as a solution to the differential equation:


Lambert's W Function

This is the inverse of [image].

To calculate W(A), use [image].


Lambert's W Function, nth Branch

This is the Nth branch of W(A), the inverse of [image].


Laplace Transform

To evaluate the Laplace transform of a function:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform / Laplace from the Symbolics menu.

Mathcad returns a function in the variable s when you perform a Laplace transform. If the expression you are transforming already contains an s, Mathcad avoids ambiguity by returning a function in the variable ss instead. Use the Substitute for Variable command to substitute a different variable or expression for s.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not "know" about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "laplace" keyword with live symbolic evaluation.

Launch QuickSheet Example


Layout Tools

As you insert various equations, text, graphics, and other regions into a worksheet, you can arrange them however you like. You can also highlight regions to make them stand out.

Selecting Regions

Moving Regions

Inserting and Deleting Blank Lines Between Regions

Manipulating Overlapping Regions

Highlighting Regions

Aligning Regions

Separating Regions

Hiding Regions


Least Common Multiple

lcm(A, B, C, ...) Returns the least common multiple: the smallest positive integer that is a multiple of all the values A, B, C, ...

Arguments:

A, B, C, ... are each a real, dimensionless, integer greater than one, or an array whose elements are real, dimensionless integers greater than one.

Examples:


Left Arrow Movement

In blank space

Move the crosshair one space to the left. If another region lies immediately to the left, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math

Moves the insertion line one character to the left. If it's already at the beginning of an expression, the editing lines move out of the expression and turn into a crosshair in the empty space to the left.

In text

Move the insertion point one character to the left. If it's already at the beginning of the text, the insertion point moves out of the text and into the empty space to the left.

Nudging regions

Moves the selected region(s) one space to the left or if held down, moves more quickly to the left.


Left Inverse Function

geninv(A) Returns the left inverse matrix L of A, such that [image].

Arguments:

  • A must be an m x n array, where m [image] n..

  • A must contain real values.


Legend Settings (Polar Plots)

Legend Settings on Polar Plots

To create a legend for identifying each trace:

  1. Double-click on a plot or choose Graph / Polar Plot from the Format menu to open a tabbed dialog box.

  2. If necessary, click on the Traces tab.

  3. Assign names to each trace by clicking the default names listed in the Legend label column of the scrolling list in the middle of the dialog box. You'll see the name reproduced in the text box below this column.

  4. To change the name of the trace, type the new name in the text box under the Legend label column.

  5. To control whether the legend is displayed or hidden, use the "Hide Legend" check box.

  6. To control whether the expressions that created the plot are also displayed, use the "Hide Arguments" check box.

  7. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Legend Settings (X-Y Plots)

To create a legend for identifying each trace:

  1. Double-click on a plot or choose Graph / XY Plot from the Format menu to open a tabbed dialog box.

  2. If necessary, click on the Traces tab.

  3. Assign names to each trace by clicking the default names listed in the Legend label column of the scrolling list in the middle of the dialog box. You'll see the name reproduced in the text box below this column.

  4. To change the name of the trace, type the new name in the text box under the Legend label column.

  5. To control whether the legend is displayed or hidden, use the "Hide Legend" check box.

  6. To control whether the expressions that created the plot are also displayed, use the "Hide Arguments" check box.

  7. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Legendre Polynomial Function

Leg(n,x) Returns the value of the Legendre polynomial of degree n at x.

Arguments:

n is a non-negative integer.

x is a real scalar.

The Legendre polynomial arises as a solution to the differential equation:


Less Than Operator

Keystroke: <

x < y Returns 1 if x < y, 0 otherwise.

Operands:

  • x and y must be real or imaginary scalars, vectors, or strings.


Less Than or Equal To Operator

Keystroke: Ctrl+9

x [image] y Returns 1 if x [image] y, 0 otherwise.

Operands:

  • x and y must be real or imaginary scalars, vectors, or strings.


Levenberg-Marquardt Method for Solving

Levenberg-Marquardt

The iterative Levenberg-Marquardt method can be used during the solving process called by find, or minerr. It involves the following:

The error vector

Steps in the Levenberg-Marquardt method

Termination criteria

Mathcad’s modifications to the Levenberg-Marquardt method

Mathcad’s method is taken from the public-domain MINPACK algorithms developed and published by the Argonne National Laboratory in Argonne, Illinois. For more information, see the User's Guide to Minpack I, by Jorge J. More, Burton S. Garbow, and Kenneth E. Hillstrom, Argonne National Laboratory publication ANL-80-74, 1980.


Lighting a 3D Plot

Overview

Lighting is one way to control the color and shading of a 3D plot, just as lighting affects the color of objects in the real world.

In the real world, the color of an object depends on its color as well as the surrounding light. For example, a yellow ball can look grayish under dim lighting while bright yellow in brighter lighting. This is due to the fact that as light shines, an object reflects and absorbs light, depending on its color. For example, a blue object reflects mostly blue light and absorbs others.

Similarly, the color of a plot depends on the color you fill it with as well as the lights shining on it. You can color a plot by filling it with a solid color or a colormap. If you then enable lighting, the plot's color can change depending on the kind and color of light you specify.

Light Settings

Light on a graph consists of:

  • Ambient light

  • Directed light

To control the lighting for a 3D Plot:

  1. Double-click on the plot to open a tabbed dialog box.

  2. Click on the Lighting tab to see the Lighting page.

  3. Use the options on this page to:

    • Enable lighting

    • Set the ambient light color

    • Choose a lighting scheme

    • Specify the diffuse color and specular color of a directed light.

    • Set the location of a directed light

    • Position a light far away

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Limit Operators

To evaluate the limit of an expression:

  1. Press Ctrl+L to create the limit operator.

    Press Ctrl+Shift+B for a limit from the left.

    Press Ctrl+Shift+A for a limit from the right.

  2. Enter the expression in the placeholder to the right of "lim."

  3. Enter the limiting variable in the left-hand placeholder below the "lim."

  4. Enter the limiting value in the right-hand placeholder below the "lim."

  5. Press Space until the entire expression is between the editing lines.

  6. Choose Simplify from the Symbolics menu.

If the limit does not exist, you'll see an error message.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Limitations on Copying Results

When you copy a result of a calculation to the clipboard, the result placed on the clipboard will differ from the original result in the following ways:

  • All numbers on the clipboard contain only as many digits of precision as were displayed in the original result.

  • Any units associated with the result are not copied to the clipboard.

  • Any trailing zeros are not copied.

  • Nested arrays in a result are copied as zeros.


Limitations on Range Variables

There are certain range variable definitions which are not allowed. These are:

The number just after the comma (if any) should be between the other two numbers.

All numbers in the definition must be real.

The dimensions (if any) of all numbers in the range must match.

A range variable cannot be defined in terms of another range variable.

A range variable cannot be defined in terms of a matrix or vector.


Limits on Array Sizes

Limit on input arrays:

When you choose Matrix from the Insert menu, you cannot create an array having more than 100 elements. You can, however, create larger arrays by:

  • Joining smaller ones together

  • Reading from a data file

  • Using range variables

  • Creating a data table

Limit on array size:

  • The effective array size limit depends on the memory available on your system. Approximately 8 bytes of memory are needed per array element. For most systems, the array limit is at least 1 million elements. In no system is it higher than 8 million elements.

  • When you display an array result in matrix form, your worksheet only displays up to 200 rows or columns.


Line Settings (3D Bar Plots)

To control the lines on a 3D bar plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Draw a frame of lines around the bars

    • Color the lines with solid color or according to a colormap.

    • Remove lines from the plot

    • Control the thickness of the lines

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Line Settings (3D Scatter Plots)

You can draw lines to connect the points on a 3D scatter plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Draw a lines connecting the points

    • Color the lines with solid color or according to a colormap.

    • Remove lines from the plot

    • Control the thickness of the lines

  4. Click "Apply" to preview the plot.

To specify the way the lines connect the points in your plot:

  1. Click on the Special tab to open the Special page.

  2. In the Connectivity section of the Special page, choose Row Order, Increasing X, Increasing Y, or Increasing Z.

  3. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Line Settings (Contour Plots)

To control the lines on a contour plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Draw lines using a colormap

    • Remove lines from the plot

    • Control the thickness of the lines

  4. When you're done, click "Apply" to preview the plot.

To specify the number of contours on a contour plot, click on the Special tab to open the Special page.

  1. Choose a contour direction from the drop-down menu at the bottom of the Contour Options section. Use Z-Contours unless you have created a contour plot on another backplane.

  2. Use the options in the Contour Options section to:

    • Specify the number of contours

    • Control whether the contours are labeled with numbers

  3. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Line Settings (Surface Plots)

To control the lines on a surface plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Draw a frame of lines colored with solid color or according to a colormap

    • Draw only contour lines using a colormap

    • Remove lines from the plot

    • Control the thickness of the lines

  4. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Line Settings (Vector Field Plots)

To format the lines on a vector field plot:

  1. Double-click on a plot to open a tabbed dialog box.

  2. Click on the Appearance tab.

  3. Use the options on the Appearance page to:

    • Color the lines with solid color or according to a colormap.

    • Control the thickness of the lines

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Linear Combination of Functions

linfit(vx,vy,F) Returns a vector containing the coefficients used to create a linear combination of the functions in F which best approximates the data in vx and vy.

Arguments:

  • vx is a vector of data values. These correspond to the x values. The elements must be in ascending order. Use the sort function if they are not.

  • vy is a vector of data values. These correspond to the y values. The number of elements is the same as vx.

  • F is a function that returns a vector whose elements are functions making up a linear function. Or in the case of a single linear function, F is a scalar.

The linfit function is useful when you have a set of measured x and y values and you want to model your data with a linear combination of arbitrary functions.

The example below illustrates the use of linfit:

Launch QuickSheet Example


Linear Interpolation

linterp(vx,vy,x) Returns a linearly interpolated value at x for data vectors vx and vy.

Arguments:

  • vx is a vector of real data values in ascending order. These correspond to the x values.

  • vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

  • x is the value of the independent variable at which you want to interpolate a result. For best results, this should be in the range encompassed by the values of vx.

In linear interpolation, Mathcad connects the existing datapoints with straight lines and interpolates for a particular value. The example below illustrates the use of linterp:


Linear method for solving

Linear

This option is used when you are solving a linear program using the find, minerr, minimize, or maximize function and need a linear programming method.

Notes:

  • A linear program has a linear objective function. A linear objective function is one of the form c0*var1+c1*var2+...cn*varn. For example, the function g(x,y):=x+y is linear.

  • The constraints in a linear program must be either equalities or inequalities which compare linear functions to constants. For example, x+2<5 is a valid constraint for a linear program.

  • You need to define guess values in the solve block if you choose the Linear option. The guess values are immaterial, however - they have no effect on the solution except when solving for a matrix or vector result. In that case, the guess value for the vector or matrix indicates the size of the vector or matrix to find.

  • The Linear option does not use the built-in variable TOL when solving.

The method used in the linear case is a simplex method with branch/bound techniques. For more information, see the solver references.

Launch QuickSheet Example


Linear Prediction

predict(v,m,n) Returns a vector of n predicted values based on m consecutive elements in v.

Arguments:

  • v is a vector whose values represent samples taken at equal intervals.

  • m and n are integers.

The predict function uses your existing data to predict data points lying beyond the existing ones. It uses a linear prediction algorithm which is useful when your data is smooth and oscillatory, though not necessarily periodic. Linear prediction can be seen as a kind of extrapolation method but should not be confused with linear or polynomial extrapolation.

The example below illustrates the use of linear prediction:


Linear Regression

line(vx, vy) Returns a vector containing the coefficients for a line of the form a+b*x that best approximates the data in vectors vx and vy.

medfit(vx, vy) Returns a vector containing the coefficients for a line of the form a+b*x that best approximates the data in vectors vx and vy using median-median regression.

Arguments:

vx is a vector of real data values. The values in vx correspond to the x values.

vy is a vector of real data values. The values in vy correspond to the y values.

Note: vx and vy must have the same number of elements.


Linked Object

An object which, when double-clicked on, opens the application that created it together with a file containing the object. Or, if the application supports in-place activation, the worksheet's menus and toolbars change to those of the other application and a hatched border surrounds the object.

Any changes you make to the object will affect the actual file containing the object.


Linking to a Database

Before inserting an ODBC Input component in a Mathcad worksheet, you must first establish a link to a database on your system or network. To do so:

  1. In Windows 2000 and XP, open the Control Panel Administrative Tools Þ Data Sources (ODBC). In Windows 95, 98, and NT, open the Control Panel ODBC Data Sources.

  2. On the User DSN tab, click "Add" to add a database.

  3. In the Create New Data Source dialog, select the driver for the database you want to access. Click "Finish".

  4. Specify the database to which you want to link. Name your data source (which you will later select in the ODBC Input Wizard) and, if desired, enter a description. Click "OK."

Exactly how you carry out this step is dependent upon the driver you select. For example, if you wanted to link to a Microsoft Access database, you would specify the database by clicking the "Specify" button and navigating to the appropriate Access (*.mdb) file, and you would name the database by filling out the Data Source Name field. Other databases may use a differently-named button, but the general procedure of specifying the database and naming it is the same, and required to create a Data Source.

  5. Click "OK" to close the Control Panel.

For more information about ODBC and SQL support, check the documentation that comes with your database application.


Links Dialog Box

The Links dialog box has the following options:

List of Links

Displays the links that exist in the worksheet.

Update Now

Updates a manual link.

Open Source

Opens the application in which the linked object was created.

Change Source

Links the object with a different source file. The new source file must have been created in the same application as the original source file.

Break Link

Breaks the link between an object’s original source and the copy of the object in the worksheet.

Update

Choose Automatic so the link updates whenever you open the worksheet and any time the source information changes while the worksheet is open.

Choose Manual so the link updates only when you update it by pressing “Update Now.”


List of numerical integration methods

Romberg - Integrates using the Romberg method of integration which is useful for most integrands.

Adaptive - Applies an adaptive quadrature method which is useful for functions that change rapidly over an interval.

Infinite Limit - Integrates using an algorithm appropriate for integrals where one or both of the limits are infinite. The function being integrated must be real.

Singular Endpoint - Uses an open-ended Romberg method which is appropriate for integrals which do not exist at one or both limits of integration.


Literal Subscript Operator

To type a literal subscript like

vinit

  1. Type the first part of the name (v), the part that comes before "sub" when you pronounce it out loud.

  2. Type a period. The insertion point extends down half a line.

  3. Type the second half of the name, the part you want in the subscript (init)

Note: You can also use the Subscript button on the Formatting toolbar to type literal subscripts.

Be sure not to confuse literal subscript with array subscripts. Although they appear identical, they are quite different.


Live symbolics not available.

The right arrow is a "symbolic equal sign" and is used for live symbolic evaluation of expressions similar to the live numerical evaluation you see when you use a "=".

Live symbolic evaluation is not available in this particular version of this software.


Local Assignment Operator in a Program

Keystroke: {

Variables defined with this operator are defined only within the program.

You can change the display of this operator to = if you want to.


Locked Area

A locked area is an area enclosed by the two padlocks shown below. You create, lock and unlock such areas by choosing from among the commands under Area on the Format menu.


Locking a Collapsed Area

After you collapse an area, you can lock it to prevent others from editing the regions inside. To lock a collapsed area:

  1. Click on the collapsed area bar.

  2. Choose Area / Lock from the Format menu.

  3. Enter and re-enter a password if you want to require a password to unlock the area. Keep in mind that the password is case-sensitive. Also bear in mind that a worksheet can contain several locked regions, each with its own separate password. If you use a password, make sure you don't forget what it is.

  4. Click "OK."

A padlock appears on the collapsed area bar indicating it is locked.


Locking the Area You've Designated

After you insert an area, you can lock it to prevent others from editing the regions inside by locking the area. To lock an area:

1. Click between the area boundaries.

2. Choose Area / Lock from the Format menu to bring up the Lock Area dialog box.

3. If you want to require a password to unlock the area, enter and re-enter a password. Note that the password is case-sensitive.

4. Click "Collapse when locked" as a shortcut to collapsing the area upon locking it.

5. Click "OK."

The area boundaries by default change appearance as in the example below:

Notes:

  • A worksheet can contain several locked regions, each with its own separate password. If you use a password, make sure you don't forget what it is.

  • After locking an area, you can collapse it to hide the regions inside.

  • To safeguard an entire worksheet, you can protect the worksheet rather than locking an area containing the entire worksheet.


Using loess and regress in higher dimensional spaces

The loess and regress functions allow you to fit an n-dimensional polynomial surface to a set of points (x1, x2, ...xn, z) by doing the following:

Each additional independent variable requires another column in Mxy.

Each additional independent variable requires another row in v.

Limitations:

  • The loess function is restricted to at most four independent variables.

  • The regress function can have any number of independent variables. However when there are more than four independent variables or when the degree of the polynomial surface exceeds four, regress will take substantially more memory and will calculate more slowly.

Additionally, the number of data values, m must satisfy:


Loess cannot extrapolate.

You are trying to use the loess function to interpolate on a value larger than the maximum value in your data set. You must interpolate for values that lie strictly between your data points.


Log Normal Distribution

Distributions associated with the Log-Normal Equation:

dlnorm(x, m , s) Returns the probability density.

plnorm(x, m , s) Returns the cumulative probability distribution.

qlnorm(p, m , s) Returns the inverse cumulative probability distribution.

rlnorm(m, m , s) Returns a vector of m random numbers having the log normal distribution.


Exponential and Logarithmic Functions

exp(z) The number e raised to the power z.

log(z,b) Base b logarithm of z. If b is omitted, base 10 log of z.

ln(z) Natural logarithm (base e) of z.

Arguments:

z must be a scalar (real, complex, or imaginary), or a vector of scalars.

z must be dimensionless.

For log and ln functions, z cannot be zero.

b is an optional, positive argument. If included, b is a scalar. If omitted, b is assumed to be 10.

For complex z, the log functions return values from the principal branch of these functions. In other words:

ln(z) = ln(|z|) + i arg(z)


Logarithmic Regression

logfit(vx,vy,vg) Returns a vector containing the coefficients for a logarithmic curve of the form a*ln(x+b)+c that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

lnfit(vx,vy) Returns a vector containing the coefficients for a logarithmic curve of the form a*ln(x)+b that best approximates the data in vx and vy.

Arguments:

  • vx is a vector of real data values. The values in vx correspond to the x values.

  • vy is a vector of real data values. The values in vy correspond to the y values.

  • vg is a three-element vector of real guess values for the parameters a, b, and c in the logarithmic equation:

Note: vx and vy must have the same number of elements.

Launch QuickSheet Example


Logistic Distribution

Distributions associated with the Logistic Equation:

dlogis(x,l,s) Returns the probability density.

plogis(x,l,s) Returns the cumulative probability distribution.

qlogis(p,l,s) Returns the inverse cumulative probability distribution.

rlogis(m,l,s) Returns a vector of m random numbers having the logistic distribution.


Logistic Regression

lgsfit(vx,vy,vg) Returns a vector containing the coefficients for a logistic curve of the form a / (1+b*e-cx) that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

Arguments:

  • vx is a vector of real data values. The values in vx correspond to the x values.

  • vy is a vector of real data values. The values in vy correspond to the y values.

  • vg is a three-element vector of real guess values for the parameters a, b, and c in the logistic equation:

Note: vx and vy must have the same number of elements.


Lookup Functions

lookup(z, A, B) Looks in a vector or matrix, A, for a given value, z, and returns the value(s) in the same position(s) (i.e., with the same row and column numbers) in another matrix, B. When multiple values are returned, they appear in a vector in row-wise order, starting with the top left corner of B and sweeping to the right.

hlookup(z, A, r) Looks in the first row of a matrix, A, for a given value, z, and returns the value(s) in the same column(s) in the row specified, r. When multiple values are returned, they appear in a vector.

vlookup(z, A, c) Looks in the first column of a matrix, A, for a given value, z, and returns the value(s) in the same row(s) in the column specified, c. When multiple values are returned, they appear in a vector.

match(z, A) Looks in a vector or matrix, A, for a given value, z, and returns the index (indices) of its positions in A. When multiple values are returned, they appear in a nested array in row-wise order, starting with the top left corner of A and sweeping to the right.

The degree of precision to which the comparison adheres is determined by the TOL setting of the worksheet

Arguments:

z is a real or complex number, or string.

A, B are real, complex or string mxn matrices or vectors.

r, c are integers, ORIGIN £ r £ ORIGIN+n-1, ORIGIN £ c £ ORIGIN+n-1.

Launch QuickSheet Example


LU Decomposition

lu(M) Returns one matrix containing the three square matrices P, L, and U, all having the same size as M and joined together side by side. Use the function submatrix to extract these smaller matrices.

These three matrices satisfy the equation [image],

where L and U are lower and upper triangular respectively.

Arguments:

  • M is a square matrix.


LU Decomposition Method

Mathcad performs the LU decomposition using Crout’s method with partial pivoting. See Numerical Recipes in C by William H. Press, Brian P. Flannery, Saul A. Teukolosky and William T. Vetterling (Cambridge University Press, 1986), pp. 31 to 39, for a complete description.


M is made of 3 Matrices RGB


Magnitude Operator

Keystroke: |

The magnitude operator performs different operations, depending upon the argument you provide:

| x | Returns the magnitude (or absolute value) of x.

| v | Returns the norm of the vector v.

| M | Returns the determinant of the square matrix M.

Operands:

x must be scalar.

v must be a vector.

M must be a square matrix.

To return the magnitude of the individual elements of an array, use the vectorize operator in conjunction with this operator.


Making a Pass Through Your Worksheet

With one exception, all math expressions in a worksheet are evaluated the same way you read: from top to bottom and from left to right. Click on the various expressions in the picture below or more explanation.


Making Another Window Active

To make another worksheet the active worksheet, either click anywhere on its window or choose its name from the Window menu.


Making the Crosshair Appear

Click in any blank spot in your worksheet to see the crosshair.


Making the Editing Lines Appear

Click anywhere in a math expression to see the editing lines.


Making the Text Insertion Point Appear

To see the text insertion point, start with a crosshair, and choose Text Region from the Insert menu.


Mantissa of a number

To get just the decimal part of a positive number, define:

mantissa(x) := x - floor(x)


Manual Calculation Mode

When you start your worksheet it defaults to automatic mode, meaning that the worksheet window automatically updates the results as you make changes.

If you don’t want to wait for the worksheet to make computations as you edit, you should change to manual calculation mode.

Advantages of manual mode...

Disadvantages of manual mode...

How to update results in manual mode...

How to tell when you're in manual mode...

How to get into manual mode...


Mapping Functions

xy2pol(x,y)

Converts the rectangular coordinates of a point in 2D space to polar coordinates.

pol2xy(r,q)

Converts the polar coordinates of a point in 2D space to rectangular coordinates.

xyz2sph(x,y,z)

Converts the rectangular coordinates of a point in 3D space to spherical coordinates.

sph2xyz(r,q,f)

Converts the spherical coordinates of a point in 3D space to rectangular coordinates.

xyz2cyl(x,y,z)

Converts the rectangular coordinates of a point in 3D space to cylindrical coordinates.

cyl2xyz(r,q,z)

Converts the cylindrical coordinates of a point in 3D space to rectangular coordinates.

Arguments:

  • x, y, z, r, q, f are real numbers.

Launch QuickSheet Example


Tools - Calculate - Automatic Calculation

Toggles between manual and automatic mode.

If checked, all visible results are automatically updated whenever you make a change in the worksheet.

If unchecked, results aren't updated until you choose Calculate/Calculate Now from the Tools menu.

When editing a worksheet that involves lengthy calculations, you may find it more efficient to work in manual mode.


Tools - Calculate - Calculate Now

Updates just the plots and numerical results visible on your immediate worksheet. For a keyboard shortcut press F9.

This command is usually only necessary when the worksheet is in manual calculation mode.

You will know the results need updating when you see the word "calc" on the message line at the bottom of the window.

If you want to update all plots and numerical results throughout the entire worksheet, choose Calculate/Calculate Worksheet from the Tools menu instead or press [Ctrl] F9.


Tools - Calculate - Calculate Worksheet

Updates all plots and numerical results throughout the worksheet.

This command is usually only necessary when the worksheet is in manual calculation mode. You'll know the results need updating when you see the word "calc" on the message line at the bottom of the window. Or you can press [Ctrl] F9.

If you want to update only the plots and numerical results currently visible, choose Calculate/Calculate Now from the Tools menu instead.


Tools - Optimize - Equation/Worksheet

Turns symbolic optimization on and off. When optimization is turned on, you'll see a checkmark beside this command. You can choose to optimize only the selected equation by clicking OptimizeÞEquation, or you can have Mathcad optimize your entire worksheet by selecting OptimizeÞWorksheet.

When optimization is turned on, the symbolic processor attempts to simplify any expression to the right of a ":=" or a "=". If it succeeds in doing so, it marks the region with an asterisk and evaluates the simpler form instead. To see the simpler form, double-click on the asterisk, or click OptimizeÞShow Optimization on the Tools menu.

To turn off optimization, choose the selected menu command again, so that the checkmark is no longer visible in the menu.

Note:

  • Equation-level optimization overrides worksheet-level optimization; if you enable worksheet optimization, you can then turn off optimization for a specific region without affecting any other optimized equations in your worksheet.


Tools - Worksheet Options

Brings up a tabbed dialog box:

  • Use the Built-in Variables tab for changing built-in variables such as TOL and CTOL.

  • Use the Calculation tab to control calculations by turning them off or symbolically optimizing them.

  • Use the Display tab to control the appearance of various operators such as the multiplication, derivative, and definition operators.

  • Use the Unit System tab for specifying a unit system to work in.

  • Use the Dimensions tab to specify dimension names used for the units being displayed.


Worksheet Options Dialog Box (Calculation Tab)

The Worksheet Options dialog box has the following options on the Calculation tab:

Recalculate automatically

When this is checked, all visible results and graphs automatically recalculate. When this is not checked, results and graphs recalculate only when you choose Calculate Þ Calculate Now or Calculate Þ Calculate Worksheet from the Tools menu. To quickly control this option, choose Calculate Þ Automatic Calculation from the Tools menu.

Use strict singularity checking for matrices

With this option selected, Mathcad performs a more rigorous check of matrix singularity than in previous versions. Therefore, you may get a message that a matrix is singular even if, previously, you were able to evaluate the matrix.

Optimize expressions before calculating

When this is checked, optimization is turned on. When optimization is turned on, the symbolic processor attempts to simplify any expression to the right of a ":=" or a "=". If it succeeds in doing so, it marks the region with an asterisk and evaluates the simpler form instead. To see the simpler form, double-click on the asterisk.

Use exact equality for boolean comparisons

Controls the standard used in boolean comparisons. When this option is checked, two numbers must differ by less than the maximum accuracy of your computer's floating point processor to be considered equal. When this option is not checked, the absolute value of the difference between two numbers divided by their average must be < 10-12 for them to be considered equal. When the option is checked, numbers between -10-307 and 10-307 are considered to be 0.

Performance Preferences

Choose whether computations are optimized for speed (Mathcad 2001 and higher) or backward compatibility (Mathcad 2000 and lower).


Worksheet Options Dialog Box (Dimensions Tab)

The Worksheet Options dialog box has the following options on the Dimensions tab:

Display dimensions

Click here to display results using the dimension names shown in the Dimension Names section rather than the default units.

Dimension Names

After you click the box next to Display dimensions you can type any dimension names here and they appear in your results involving units.


Worksheet Options Dialog Box (Display Tab)

The Worksheet Options dialog box has the following options on the Display tab:

The operators listed in the Operator Display section are those whose appearance you can specify. Make selections in the View As drop-down menus to specify the appearance for the operators in the worksheet:

Multiplication

Specify how the multiplication operator displays:

AutoSelect | How it appears depends on its context. For example: 8 z (thin space is used when a variable follows a constant) 8z.9 (a dot is used when a constant follows a variable) 2 x 4 (an X appears between two constants)
Dot | z . 2
Large dot | z.2
X | z x 2
Thin space | z 2
No space | z2
Thin dot | z.2

Default is Dot, or Thin dot for worksheets created in earlier versions of Mathcad.

Derivative

Specify how the derivative operator displays:

Derivative

Partial derivative

Default is Derivative.

Literal Subscript

Specify how the literal subscript displays:

Large Subscript | vinit
Small Subscript | vinit

Default is Small Subscript.

Definition

Specify how the definition symbol displays:

Colon equal | z:=2
Equal | z=2

Default is Colon equal.

Global definition

Specify how the global definition symbol displays:

Triple equal |
Equal | z=2

Default is Triple equal.

Local definition

Specify how the local definition symbol displays:

Left Arrow |
Equal | z=2

Default is Left arrow.

Equality

Specify how the equal-to operator displays:

Bold equal |
Equal | z=2

Default is Bold equal.

Notes:

  • To change the display of individual operators in an expression, click on the operator with the right mouse button and choose View [operator] As from the pop-up menu.


Worksheet Options Dialog Box (Built-In Variables Tab)

The Worksheet Options dialog box has the following options on the Built-In Variables tab:

Array Origin

Controls the built-in variable ORIGIN which represents the starting index of all arrays in your worksheet. Default is 1.

Convergence Tolerance

Controls the built-in variable TOL which specifies the precision to which integrals and derivatives are evaluated. It also controls the length of the iteration in solve blocks and in the root function. Default is 0.001.

Constraint Tolerance

Controls the built-in variable CTOL which specifies how closely a constraint in a solve block must be met for a solution to be acceptable. A solve block controlled by CTOL consists of the word Given, one or more constraints to be met, and an optimizing function: minimize, maximize, find, or minerr. Default is 0.001.

Seed value for random numbers

Tells a random number generator function to use a certain sequence of random numbers. To select a different sequence of random numbers, change the value. Default is 1.

Precision

Controls the built-in variable PRNPRECISION which represents the number of significant digits to be used when writing to an ASCII data file with the WRITEPRN or APPENDPRN function. Default is 4.

Column Width

Controls the built-in variable PRNCOLWIDTH which represents the width of columns in ASCII files created by the WRITEPRN or APPENDPRN function. Default is 8.

Restore Defaults button

Reverts all values to their default values (shown in the parentheses to the right of each value).


Worksheet Options Dialog Box (Unit System Tab)

The Worksheet Options dialog box has the following options on the Unit System tab:

SI (International)

Click here to display results in terms of meters, kilograms, seconds, amps, Kelvin, candellas, and moles unless otherwise specified. Example:

MKS

Click here to display results in terms of meters, kilograms, seconds, coulombs, and Kelvin unless otherwise specified. Example:

CGS

Click here to display results in terms of centimeters, grams and seconds unless otherwise specified. Example:

US

Click here to display results in terms of feet, pounds, seconds and coulombs unless otherwise specified. Example:

None

Click here to disable all built-in units. Note that the units in the picture below are displayed in red to show that they are undefined. Example:


Math Region

This is a region containing a math expression or a plot. Math regions are live. This means changes you make to them will affect other math regions throughout the worksheet.


Math Style (defined)

Math Style

A style consists of a font, size and style combination. Whenever you type a variable name, the worksheet assigns to it a math style named “Variables” which has a particular font, size, and style associated with it. Similarly, when you type a constant, the worksheet assigns to it a math style named “Constants” which also has a particular font, size, and style associated with it.

To see what math style is currently assigned to a name or number, click on the name or number and look at the math style window on the font bar or choose Equation from the Format menu.

To change the font characteristics of a style:

  1. Choose Equation from the Format menu.

  2. Select a style and click “Properties.”

To change the math style associated with a name or number:

  1. Click in the name or number.

  2. Choose Equation from the Format menu.

  3. Select a style and click “OK.”


Math Toolbar

The buttons on the Math toolbar give you quick access to the other mathematical toolbars. To learn what toolbar a button brings up, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.

To customize the Math toolbar, click on it with the right mouse button and choose Customize from the pop-up menu.


Matrix (defined)

A matrix is a rectangular array of numbers.


Matrix Bar Layout Button

Matrix Bar Layout

When this button is clicked, the bars are arranged in exactly the same way that the corresponding numbers in the underlying matrix are arranged.


Matrix division operator

Matrix division

Keystroke: /

Divides every element of A by z.

Operands:

If A is a matrix

z is a nonzero scalar

To divide every element of an m x n matrix A by the corresponding element of another m x n matrix B select the entire expression and press Ctrl+- to insert the vectorize operator.


Matrix Element Proportional Height

The height is proportional to the value of the matrix element.


Matrix exponentiation operator

Matrix powers

Keystroke: ^

Depending on n, this returns one of the following:

If n = 0 this returns the identity matrix whose dimensions match those of M.

If n = 1 this just returns M.

If n = -1 this returns inverse of M if it exists.

If n is a positive integer this multiplies M by itself n times.

If n is a negative integer this multiplies the inverse of M by itself n times.

Operands:

M is square.

n is a dimensionless integer.

You can evaluate matrix powers symbolically. To do so:

Select the expression to evaluate.

Choose Simplify from the Symbolics menu.


Matrix Format for READBMP

This should be an m x n matrix, each element of which corresponds to a pixel. The elements of the matrix are numbers representing the amount of grayness associated with the corresponding pixel.

The meaning of the numbers is as follows:

  • 0 means black and 255 means white.

  • Numbers between 0 and 255 correspond to levels of gray.

  • Numbers less than 0 and greater than 255 are treated as modulo 255.

  • Non-integers are rounded to the nearest integer.


Matrix Format for READRGB

This should be an m x 3n matrix. You can think of this as three m x n matrices placed side by side as follows:

The first n columns represent the red component of the n x m image. The second and third sets of n columns represent the green and blue components of the image.


Matrix Inverse Operator

Keystroke: ^-1

This returns the inverse of a matrix. If M does not have an inverse, you'll see an appropriate error message.

Operands:

  • M is a square matrix having an inverse.


Matrix is singular. Cannot comput its inverse.

Matrix is singular. Cannot compute its inverse.

This matrix must be neither singular nor nearly singular. A matrix is singular if its determinant is equal to zero. A matrix is nearly singular if it has a high condition number.


Matrix multiplication operator

Matrix multiplication

Keystroke: *

Returns the matrix product of A and B.

Operands:

If A is an m x n matrix

B is an n x p matrix

Notes:

  • If A is a matrix and x is scalar, then the product of A and x is a matrix in which each element of A has been multiplied by x.

  • To get the term by term product of two equal size arrays A and B, select the entire expression and press Ctrl+- to insert the vectorize operator.


Matrix Returned by the lu Function


Matrix Toolbar

The Matrix toolbar buttons give you quick access to matrix and vector operators. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Maxima and Minima of an Array

max(A, B, C, ...) Returns the largest value from A, B, C, ...

min(A, B, C, ...) Returns the smallest value from A, B, C, ...

Arguments:

  • A, B, C, ... can be arrays, scalars, or strings.

When any value has complex elements:

  • max(A, B, C, ...) returns the largest real part of any value plus i times the largest imaginary part of any value.

  • min(A, B, C, ...) returns the smallest real part of any value plus i times the smallest imaginary part of any value.


Minimizing or Maximizing a Function

Minimize(f, var1, var2, ...) Returns the values of var1, var2, ... which satisfy the constraints in a solve block and which make the function f take on its smallest value.

Maximize(f, var1, var2, ...) Returns the values of var1, var2, ... which satisfy the constraints in a solve block and which make the function f take on its largest value.

Arguments:

  • var1, var2, ... are scalar variables found in the solve block. They are defined above the solve block as guess values.

  • f is a function defined above the solve block. For example, an argument g could refer to the function g(x,y):=x/y.

Using the functions:

To use the minimize or maximize function:

  • Define the function to maximize or minimize.

  • Define guess values for the variables being solved for.

  • Type the word Given to start the solve block.

  • Beneath the Given, type equalities and inequalities which act as constraints using boolean operators.

  • Enter the Minimize or Maximize function with the appropriate arguments.

Notes:

  • These functions return a scalar when only one variable is involved. Otherwise they return a vector whose first element is var1, second element is var2, and so on.

  • If there are no constraints, the word Given is not necessary.

  • You can type the Minimize and Maximize functions are not case-sensitive.

Examples:

Maximizing and minimizing linear and nonlinear functions

Launch QuickSheet Example


Maximizing the Size of a Window

Click on the maximize button in the upper right corner of the window.


Mblue is one part of Matrix RGB


MCM file

What is an MCM file?

An MCM file is created by saving a customized Scripted Object component from a Mathcad worksheet. Once a Scripted Object is saved to an MCM file, the MCM file can be redistributed to other Mathcad users such that the custom component becomes available to them.


Mean Function

Arguments:

A, B, C, ... are m x n arrays or scalars.

Examples:

Other functions for data analysis...

Launch QuickSheet Example


Median Function

median(A, B, C, ...) Returns the median of A, B, C, ...

Arguments:

A, B, C, ... are arrays or scalars.

Note:

The median is the value above and below which there are an equal number of values. If there are an even number of values, this is the arithmetic mean of the two central values.

Examples:

Launch QuickSheet Example

Other functions for data analysis...


Menu Commands

File

Edit

View

Insert

Format

Tools

Symbolics

Window

Help


CreateMesh Example

Let us use the following function as an example:

You graph the function F by typing the function name below the definitions and selecting Graph / Surface Plot from the Insert menu. This results in a 3D surface plot of the function that uses the following defaults: a range of -5 to 5 for both x and y with a 20x20 grid of points and a Cartesian mapping.

Let us say you want to increase the range for both x and y to -10 to 10, increase the number of grids in x, and decrease the number of grids in y. You can use the CreateMesh function to do this as follows:

The changes are clearly visible in the graph.

It is not necessary to assign each argument of CreateMesh to a variable, but it is good style to do so.


Method Used in Sorting Functions

Mathcad’s sorting routine for the sorting functions sort, csort, and rsort uses a heapsort algorithm. See Numerical Recipes in C by William H. Press, Brian P. Flannery, Saul A. Teukolosky and William T. Vetterling (Cambridge University Press, 1986) for a complete description.

The heapsort procedure is not a stable sort. This means that if you sort a matrix on a columns that contains equal elements, the rows containing these elements will be adjacent in the sorted array, but will appear in an arbitrary order.


Mgreen is one part of Matrix RGB


Minimizing the Size of a Window

Click on the minimize button in the upper right corner of the window.


Miscellaneous Functions

mod(x, y)

Returns x mod y, the remainder on dividing x by y.

angle(x,y)

Angle from x axis to the point (x,y).


Mixed integer programming

Mixed Integer Programming (MIP)

Mixed Integer Programming refers to the ability to solve equations or optimize functions such that the variables are forced to be integers or binary numbers.

When you have the Solving and Optimization Extension Pack (Expert Solver) installed, you can perform mixed integer programming. For example, you can solve the equation y + x = 1.1 and force Mathcad to return results for x and y that are either binary or integer.

  1. Create a solve block. Use one of these functions: find, minerr, minimize, or maximize.

  2. As the last argument to the function, enter a string containing as many characters as variables you are solving for or optimizing. For example, if you are solving for three unknown variables, include three characters in the string. Each character indicates the kind of number to return and must be one of the following:

I (for an integer)

C (for any number in the continuous domain)

B (for a binary number)

Example:

Note:

  • Mixed integer programming only applies to linear or quadratic expressions.


Mixed Number Operator

Keystroke: Ctrl +

Returns the value of k + m/n.

Operands:

k, m and n are integers


Mixed Numbers

To enter a mixed number:

  1. Insert the mixed number operator by typing Ctrl++ or clicking the mixed number operator button on the Calculator toolbar.

  2. Fill in the left-most placeholder with the whole number. Fill in the other two placeholders with the fractional portion.

Example:

To display a result as a mixed number:

  1. Double-click on the result to bring up the Result Format dialog box.

  2. Choose Fraction for the result format on the Number Format tab.

  3. Click the box next to "Use mixed numbers" so that it is checked.


Mode

mode(A, B, C, ...) Returns the value in A, B, C, ... that occurs most often.

Arguments:

A, B, C, ... are arrays or scalars.

If no value in A, B, C, ... occurs more frequently than any others, you see an error message indicating there is no mode.

Example:

Other functions for data analysis...


Modifications to the Levenberg-Marquardt Method

To make the Levenberg-Marquardt method more effective on actual problems, Mathcad includes the following modifications to the basic method:

  • The first time the solver stops at a point that is not a solution, Mathcad adds a small random amount to all the variables and tries again. This helps avoid getting stuck in local minima and other points from which there is no preferred direction. Mathcad does this only once per solve, the first time the solver stops on a point that is not a solution.

  • If you include inequality constraints in a solve block, Mathcad solves the subsystem consisting of only the inequalities first before adding in the equality constraints and attempting a full solution. This is equivalent to moving the guesses into an area where the inequalities are all satisfied before starting the solver.


Modified Internal Rate of Return

mirr(v, fin_rate, rein_rate) Returns the modified internal rate of return for a series of cash flows occurring at regular intervals given a finance rate payable on the cash you borrow and a reinvestment rate earned on the cash you reinvest.

Arguments:

v is a vector of cash flows assigned at regular intervals. There must be at least one positive and one negative number in v.

fin_rate is the finance rate payable on borrowed cash flows.

rein_rate is the reinvestment rate earned on the cash flows as you reinvest them.

Example:

To start a business you borrow $10,000 with a finance rate of 9.7%. You expect the business to make $1,000, $2,500, $3,000, and $5,000 over the first five years and you reinvest the profit each year at 10.0%. The modified internal rate of return is:


Modifier Toolbar

The buttons on the Modifier toolbar insert modifiers used with symbolic keywords located on the Symbolic toolbar. To learn what a button on the toolbar does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Modifying a Math Style

To edit the font characteristics associated with a particular math style:

  1. Choose Equation from the Format menu.

  2. In the Equation Format dialog box, choose the style whose properties you want to change. You'll see the name of the selected style in the "Style Name" text box. Unless you want to change the font of all variables or all constants, you should edit User math styles.

  3. Change the style name if necessary by typing it into the "New Style Name" text box. Changing the style names makes it easier to remember what font characteristics are associated with it.

  4. Click the "Modify" button.

  5. In the dialog box, choose from among the available font properties. When you find a combination of properties you like, click "OK" in the font dialog box and "OK" in the Equation Format dialog box.

Note that changing the characteristics associated with a math style will change the font of all variables or constants having that style.


Modifying the Default Template

When you create a worksheet, you choose a template on which to base it. By default, Mathcad uses the NORMAL.MCT template. You can:

  • Modify NORMAL.MCT as you would any other template, or

  • Create a new template and replace NORMAL.MCT with it. This is useful if you want to keep NORMAL.MCT as it is. To do so, follow these steps:

    1. Open the NORMAL.MCT file, located in the \template folder of the main folder.

    2. Choose Save As from the File menu and type a name such as NORMALOLD.MCT. This saves the template file in case you want to use it again later.

    3. Create a new template to use as the default. Call it as NORMAL.MCT and save it in the \template folder of the main folder.


Modulo function

mod(x,y) This function returns the remainder on dividing x by y. Result has same sign as x.

Arguments:

x and y should both be real scalars.

y must be nonzero.


Moving a Window

With the pointer on the window's title bar, press and hold down the mouse button and drag the window. When you've correctly positioned the window, release the mouse button.


Moving the Crosshair

To move the crosshair, click in another blank spot, or use the arrow keys to move it in the corresponding direction. Use PgUp and PgDn to move up or down about 80% of the window height.


Moving the Text Insertion Point

To move the text insertion point:

Use any of the arrow keys to move character by character or line by line within text. Pressing Ctrl and an arrow key moves the insertion point word by word or paragraph by paragraph.

Clicking the mouse in text.


Moving a Toolbar

To move a toolbar:

  1. Place the mouse pointer anywhere other than on a button or a text box.

  2. Press and hold down the mouse button and drag.

You’ll find that some toolbars rearrange themselves appropriately depending on where you drag them. Others retain their shapes no matter where you drag them.


Mred is one part of Matrix RGB


Multiplication Operator

Keystroke: *

This returns the product of y and x.

Operands:

x and y are scalars.

Implied multiplication is also supported, meaning that you do not necessarily have to use the multiplication operator between constants and variables. For example, you can type 5x and it is understood as 5*x.

Implied multiplication is not supported for the variables o and h, however, because those are reserved for typing octal and hexadecimal numbers.

You can change the display of this operator to a larger dot, an X, a thin space, or no space if you want to.


Multivalued Functions and Operators

As a general rule, when a function or operator is multivalued, the value 0.5 + .866i is returned, despite the fact that we commonly think of the cube root of -1 as being -1.

The single exception to this rule is the nth root operator. This operator always returns a real root whenever one is available.


Multivariate Cubic Spline Interpolation

Two dimensional cubic spline interpolation lets you pass a surface through a grid of points in such a way that the first and second derivatives of the curve are continuous across each point. This surface corresponds to a cubic polynomial in x and y in which the first and second partial derivatives are continuous in the corresponding direction across each grid point.

cspline(Mxy,Mz) Returns a vector of second derivatives for data arrays Mxy and Mz. This vector becomes the first argument of the interp function. The resultant surface is cubic at the edges of the region spanned by Mxy.

pspline(Mxy,Mz) Same as cspline, except that the resultant surface is parabolic at the boundaries.

lspline(Mxy,Mz) Same as cspline, except that the resultant surface is linear at the boundaries.

interp(vs,Mxy,Mz,v) Returns a spline interpolated value of Mz at the x and y coordinates specified in v.

Arguments:

Mxy is an n x 2 array specifying the x and y coordinates along the diagonal of the rectangular grid over which interpolation is to take place.

Mz is an n x n array of real data. These are the z values corresponding to x and y values in Mxy.

vs is a vector generated by either cspline, pspline or lspline.

v is a vector whose two elements are the values of x and y at which you want the interpolated value of z. For best results, the values of x and y should be in the range encompassed by the grid points.

Launch QuickSheet Example


Multivariate Polynomial Regression

regress(Mxy,vz,n) Returns a vector which interp uses to find the nth order polynomial surface that best fits the x, y and z data values.

interp(vs,Mxy,vz,v) Returns the z value corresponding to the x and y values you supply in v.

Arguments:

Mxy is an m x 2 matrix containing x and y coordinates.

vz is an m element vector containing the z coordinates corresponding to the m points specified in Mxy.

vs is the vector generated by regress.

n is a positive integer specifying the order of the polynomial surface you want to use to fit the data. Usually you'll want n < 5.

v is a two element vector whose elements are the x and y values at which you want to evaluate the corresponding z coordinate on the regression surface.

Notes:

  • Regress is useful when you have a set of measured y values corresponding to x values and you want to fit a single polynomial of any order to those y values.

  • The regress function can have any number of independent variables. However when there are more than four independent variables or when the degree of the polynomial surface exceeds four, regress will take substantially more memory and will calculate more slowly.

Additionally, the number of data values, m must satisfy:

where k is the number of independent variables, expressed as the number of columns in Mxy.

  • You should always use interp after using the regress function.

  • Since regress tries to accommodate all your data points using a single polynomial, it will not work well when your data does not behave like a single polynomial.

Launch QuickSheet Example


Multivariate polynomial regression, localized

loess(Mxy,vz,span) Returns a vector which interp uses to find a set of second order polynomial surfaces that best fit the x, y and z data values specified in Mxy and vz within a neighborhood of the x and y data values. span controls the size of this neighborhood.

interp(vs,Mxy,vz,v) Returns the z value corresponding to the x and y values you supply in v.

Arguments:

Mxy is an m x 2 matrix containing x and y coordinates.

vz is an m element vector containing the z coordinates corresponding to the m points specified in Mxy.

vs is the vector generated by either loess or regress.

span is a positive real number for specifying how big a neighborhood you want to use. Use larger values of span when the data behaves very differently over different ranges of x. A good default value is span=0.75.

v is a two element vector whose elements are the x and y values at which you want to evaluate the corresponding z coordinate on the regression surface.

Notes:

  • You can use loess when you have a set of measured z values corresponding to x and y values and you want to fit a polynomial surface through those z values.

  • The loess function is restricted to at most four independent variables.

  • You should always use the interp function after using the loess function.

  • loess tries to fit different second order polynomials depending on where you are on the curve. It does this by examining the data in a small neighborhood of the point you are interested in. The span argument controls the size of this neighborhood. As span gets larger, loess becomes equivalent to regress with n=2.


Must be 1 complex matrix or 2 real

Must be 1 complex matrix or 2 real matrices.

To create a vector field plot, you must supply either one matrix of complex numbers or two real matrices having the same number of rows and columns.

If you use a complex matrix, it should be one in which:

  • The rows and columns represent the x and y coordinates.

  • The real part of each matrix element is the x-component of the vector associated with that row and column.

  • The imaginary part of each element is the y-component of the vector associated with that row and column.

If you use two m x n matrices of real numbers:

  • The first matrix should have the x-components of the vectors.

  • The second matrix should have the y-components of the vectors.


Must be a real scalar.

This value cannot be complex or imaginary. If you’re using a built-in function, click on the function name and press F1 for additional information.


Must be a vector of real elements.

Must be a vector with real elements.

This vector cannot have complex or imaginary elements. The vector must also be a column-vector (1 column, several rows) rather than a row-vector (1 row, several columns).


Must be between two lock regions.

In order to use the Area / Lock command from the Format menu, you must click in an area of the worksheet that is in a locked area.


This value must be greater than or equal to 10.0^-16.

This value must be greater than or equal to 10^-16. If you are using a built-in function, click on the function name and press F1 for additional information.


Must be integer greater than 1.

This value must be an integer greater than 1.

This value must be 1 or higher. If you’re using a built-in function, click on the function name and press F1 for additional information.


Must be less than the number of data points.

This argument must be smaller than the number of data points you have. If you’re using a built-in function, click on the function name and press F1 for additional information.


This value must be an odd integer.

This argument must be an odd integer.

If you’re using a built-in function, click on the function name and press F1 for additional information.


Must have 1 or 2 columns.

The first matrix argument in the cubic spline functions must have either one or two columns. Two columns are necessary for multivariate cubic spline interpolation.


Must have 3 vectors or one matrix.

Must have three vectors or one matrix.

You must specify the names of three vectors separated by commas or one name or a matrix. For example, you must do this when creating a vector field plot.


Must have more than four rows.

This matrix must have at least five rows and columns.


Negation operator

Negation

Keystroke: -

-x

This returns the negative of its operand.

Operands:

x is a scalar.


Negation Operator for Arrays

Negate an Array

Keystroke: –

–A

Returns an array the same size as A containing the negative of each element of A. It is equivalent to multiplying A by –1.

Operands:

A is an array

Launch QuickSheet Example


Negative Binomial Distribution

Distributions associated with the Negative binomial equation:

dnbinom(k,n,p) Returns the probability density for the negative binomial distribution.

pnbinom(k,n,p) Returns the cumulative probability distribution.

qnbinom(p,n,r) Returns the inverse cumulative probability distribution.

rnbinom(m,n,p) Returns a vector of m random numbers having the negative binomial distribution.


Net Present Value

npv(rate, v) Calculates the net present value of an investment given a discount rate and a series of cash flows occurring at regular intervals.

Arguments:

rate is the fixed interest rate at which an investment earns interest per period. rate must be a real scalar. It may be expressed as a decimal such as .0825 or as a percent such as 8.25%.

v is a vector of cash flows assigned at regular intervals.

Notes:

  • npv assumes that the payment is made at the end of the period.

  • In the vector of cash flows, v, payments must be entered as negative numbers and income must be entered as positive numbers.

  • The npv investment begins one period before the date of the first cash flow and ends with the last cash flow in the list.


Next Page

Shows the next page of your worksheet in the Print Preview screen. If this button is gray, there are no further pages in your worksheet.


No Answer Found

The symbolic processor could not find an exact solution for the equation you were solving.


No Answer Found; Stack Limit Reached

The symbolic processor reached the limit of its internal expression stack without completing the evaluation or simplification you requested.


No palleted regions were found in the worksheet.

You will see this error if you chose Color / Optimize Palette from the Format menu. This command should be use only when you have bitmaps embedded in a worksheet.


No Closed Form Found

The symbolic processor couldn't find an indefinite integral for the expression you were integrating, or a closed form for the sum or product you were evaluating.


Could not find a solution.

A solution could not found. If you’re using a built-in function, click on the function name and press F1 to make sure you are using the function correctly. It is possible, however, that no solution exists.


Nominal Interest Rate

nom(rate, nper) Returns the nominal interest rate, given the effective annual interest rate (APR) and the number of compounding periods per year.

Arguments:

rate is the effective annual interest rate. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate [image] -1.

nper is the total number of compounding periods per year. nper>0.

Example:

A 30-year loan or investment with an effective annual interest rate of 10.5014% has a nominal interest rate of:

nom(.105014,360) = 9.987 %


Norm of a Matrix

norm1(M) Returns the [image] norm of the matrix M.

norm2(M) Returns the [image] norm of the matrix M.

norme(M) Returns the Euclidean norm of the matrix M.

normi(M) Returns the infinity norm of the matrix M.

Arguments:

  • M must be a square matrix.


Normal Distribution

Distributions associated with the Normal equation:

dnorm(x, m , s) Returns the probability density for the normal distribution.

pnorm(x, m , s) Returns the cumulative probability distribution.

cnorm(x) Returns the cumulative probability distribution with mean 0 and variance 1.

qnorm(p, m , s) Returns the inverse cumulative probability distribution.

rnorm(m, m , s) Returns a vector of m random numbers having the normal distribution.

Launch QuickSheet Example


Not a scalar

You used a vector or ranged expression or another kind of expression where a scalar is required.


Not enough memory for this operation.

There is not enough memory to complete this computation. Try to free up some memory by making the array or matrix smaller (approximately 8 bytes of memory are used per matrix element) or by deleting any large bitmaps, arrays, or matrices.


Not Equal to Operator

Not Equal To

Keystroke: Ctrl+3

x [image] y

Returns 1 if x [image] y, 0 otherwise.

Operands:

x and y can be real or complex scalars or arrays.


Not operator

Not

Keystroke: Ctrl+Shift+1

x Returns 1 if x is zero (false). Returns 0 otherwise.

Operands:

x is a real or complex scalar.

Note:

A value of 0 is FALSE, any non-zero value is TRUE.

Launch QuickSheet Example


Notes on the S-Plus Script Code

When editing the S-Plus Script component, your S-PLUS code, which can include multiple statements, is inserted within an automatically created function to run the component. This code can use temporary variables, but any temporary variables are not visible outside of the component (unless assign is called to change the S-PLUS databases). For example, a script could contain out0 <- sin(in0) to set the output to the sine of the input.

The following variables can be accessed within a script:

  • input.var.names and output.var.names are vectors of strings that give the input and output variable names for the component. You can use these variables to write scripts that handle different numbers of inputs and outputs.

  • first.call has a value of T if this is the first time this script has been executed.

This variable can be used to initialize static variables.

If “Show Captured Results” on the component’s pop-up menu is checked, the component displays the text produced by the last execution of the S-PLUS program, including any printing done by the script, as if it had been executed at the S-PLUS command line. Capturing this text can slow down the execution. Error messages are always captured, however, so after an error occurs the display can be switched to see the error message.


Nothing to unlock.

In order to use the Area / Unlock command from the Format menu, you must click in an area of the worksheet that is in a locked area.


Nth Derivative operator

Nth derivative

Keystroke: Ctrl+Shift+?

Returns the nth derivative of f(t) evaluated at the point t.

Operands:

f(t) is a scalar valued function.

t is the point at which the derivative is to be evaluated.

n= 0, 1, 2, 3, 4 or 5.

You must first define the point at which the derivative is to be evaluated. For example:

Notes:

  • In the above example that the value returned is the nth derivative of f with respect to t evaluated at whatever point(s) t is defined at.

  • Although the example shows a function of one variable, f can be a function of any number of variables.

  • If f has several terms, be sure to enclose them in parentheses to keep them inside the derivative operator.

  • With Mathcad’s derivative algorithm, you can expect the first derivative to be accurate to within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.

Launch QuickSheet Example


Nth root operator

Nth root

Keystroke: Ctrl+\

Returns the nth root of x.

Operands:

x must be a scalar.

n must be a positive integer.

This returns a real valued root whenever one is available. To return the principal value of the nth root of x, raise x to the power 1/n instead.


Number of Compounding Periods

cnper(rate, pv, fv) Returns the number of compounding periods required for an investment to yield a specified future value given a present value and an interest rate per period.

Arguments:

rate is the fixed interest rate at which an investment earns interest per period. rate must be a real scalar. It may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate > -1.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

pv is the present value of the investment. pv [image] 0.

fv is the future value of the investment. fv > 0.


Number of Elements in a Vector

length(v) Returns the number of elements in the vector v.

last(v) Returns the index of the last element in the vector v.

Arguments:

  • v must be a vector.

To get the Euclidean length of v, use the magnitude operator |.


Number of Periods

nper(rate, pmt, pv, [[fv], [type]]) Returns the number of periods for an investment or loan based on periodic, constant payments using a fixed interest rate and a specified present value.

Arguments:

rate is the fixed interest rate at which an investment earns interest per period.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

pmt is the payment made each period. It usually includes principal and interest but no other taxes or fees.

pv is the present value.

fv (optional) is the future value. If omitted, fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers. Specific to nper, if pmt > 0, rate and pv must be opposite signs.


Numbers

You can apply the consecutive numbers 1,2,3, etc. to paragraphs within text regions. For example, the following three paragraphs have numbers:

  1. Line 1

  2. Line 2

  3. Line 3

To put numbers on one or more paragraphs in a text region:

  1. Select text within the paragraph(s).

  2. Choose Paragraph from the Format menu.

  3. Select "Numbers" next to Bullets in the Paragraph Format dialog box and click “OK.”

Or to quickly apply numbers:

  1. Select text within the paragraph(s).

  2. Click on the numbers button [image] on the Formatting toolbar.


Numbers in a Variable Name

The numbers 0 through 9 can appear anywhere in a name except as the leading character. For example, the name 'x2' is legal, but not the name '2x'.


Numerical Derivation Method

The derivative operator uses a variation on Ridder’s method to compute derivatives of order between 0 and 5 inclusive. It begins with the determination of an initial stepsize and the construction of a triangular array of estimates. This proceeds as follows:

The first estimate is computed in the table using an n+1-point divided difference approximation.

The remaining estimates in the first row of the table are computed using the divided difference formula but with a decreasing step-size:

The remaining elements in this table of estimates are computed using weighted averages of earlier elements:

The error for a particular estimate of the derivative’s value is given by:

Let errmin be the smallest of the i and j elements of err and let der be the estimate of the derivative’s value corresponding to errmin. Then if:

where E is a small number depending on the order. Mathcad returns der as the value of the derivative. Otherwise, the derivative is marked with an error message.

Note about the algorithm:

With Ridder’s algorithm, you can expect the first derivative to be accurate within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.


Numerical Integration Methods

There are four well-established numerical integration methods available within the integration operator. Different methods work best on different types of integrals. Mathcad attempts to automatically select the most appropriate method when the integral is evaluated.

The available methods are:

  • Romberg - Integrates using the Romberg method of integration which is useful for most integrands.

  • Adaptive - Applies an adaptive quadrature method which is useful for functions that change rapidly over an interval.

  • Infinite Limit - Integrates using an algorithm appropriate for integrals where one or both of the limits are infinite. The function being integrated must be real.

  • Singular Endpoint - Uses an open-ended Romberg method which is appropriate for integrals which do not exist at one or both limits of integration.

To see which method was chosen, or to override the chosen method:

  1. Click on the integral symbol in an evaluated integration with the right mouse button. You'll see Autoselect has a check next to it, and the chosen method is indicated with a dot.

  2. Move the cursor past AutoSelect on the pop-up menu, until the method you wish to use is highlighted.

  3. Click on the new method.

  4. Click outside the integration expression in your worksheet.

The integral will be reevaluated using the method you selected and is evaluated that way from then on, unless you specify another method or choose AutoSelect again.

Notes:

  • Decreasing TOL may improve your results, but at some point will make the integral fail to converge. A good working range is 10-4 to 10-6.

  • Setting large-valued endpoints to infinity and using the infinite endpoint algorithm may yield better answers.

  • Sharply peaked integrands, or functions whose shape is not readily characterized by a single length scale will not evaluate accurately. This is the nature of the numerical algorithms. Accurate results may be obtained by breaking an integral into pieces and separately integrating around the peak and away from the peak.

  • Integrals with a closed-form solution can be symbolically integrated, yielding precise results.


Numerical Issues in Inverse Trig Functions

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.


Numerical Method Accuracy

Since Mathcad is a general-purpose calculation program, it uses numerical methods that work in a wide variety of contexts. However, as with any numerical algorithms, it is always possible to find specific examples for which your worksheet’s methods return inaccurate or misleading results.

You can verify the accuracy of your results and avoid numerical problems by following these principals:

  • When you use a function or operator that involves a numerical approximation, be sure your results are reasonable.

  • Review the information available for the operator or function in question. In cases where you suspect the worksheet’s methods may fail, restate the problem in a more stable form.

  • Become familiar with the numerical methods to get a better understanding of the conditions under which they will fail or return inaccurate answers.

  • Set the built-in variable TOL to achieve the desired accuracy and speed for numerically computed answers.

Launch QuickSheet Example


Numerical Method for Computing a Matrix Inverse and Determinant

To compute the determinant or inverse of a square matrix M, Mathcad decomposes it into a lower-triangular matrix L and an upper triangular matrix U, such that:

This is called the LU decomposition of the matrix. It makes the solution of a system of equations:

into a matter of simple substitutions with the elements of L, U, and y.

  • To compute the inverse, Mathcad solves the equations:

where e is a vector with one in element j and a zero in all other elements. The solution vectors v for each j form the columns of the inverse matrix.

  • The determinant of the original matrix is simple the product of the diagonal elements of U, the upper-triangular matrix in the LU decomposition.


Numerical Methods

Here are descriptions of the numerical methods used for some types of calculations.

  • Integration

  • Derivation

  • Root function

  • Solving equations

  • Matrix determinants and inverses

  • Sorting

  • Zero factors or numerators

  • Numerical method accuracy


Numerical Result

A numerical result is one that appears to the right of the equals sign "=".


Numerical Results with Symbolics

Symbolic calculation is often useful for getting numerical results, particularly in cases like the following:

The results from the symbolic processor depend on whether the constants in your equation contain decimal points. If your constants are pure rational numbers like 1/2 or 4, the symbolic solver will try to find an exact solution. But if you type a decimal number (such as .5 instead of 1/2), the symbolic solver will return an approximate numerical answer.

You can also force numerical evaluation by the symbolic processor by using the Floating Point Evaluation command from the Evaluate pull-right menu.

Note:

To change floating point precision from the worksheet default of 20 decimal places, select any math expression in your worksheet and select Evaluate Þ Floating Point from the Symbolics menu. Change the setting and then click "OK".


Partial Differential Equation Solver

numol(x_endpts, xpts, t_endpts, tpts, num_pde, num_pae, pde_func, pinit, bc_func)

Returns an xpts by tpts matrix containing the solutions to the one-dimensional PDE in pde_func. Each column represents a solution over 1-D space at a single solution time. For a system of equations, the solution for each function is appended horizontally, so the matrix always has xpts rows, and tpts * (num_pde + num_pae) columns.

Arguments:

x_endpts, t_endpts are two-element column vectors that specify the real endpoints of the integration regions.

xpts, tpts are the integer number of points in the integration regions at which to approximate the solution.

num_pde, num_pae are the integer number of partial differential, and partial algebraic equations, respectively. num_pde must be at least 1, num_pae can be 0.

pde_func is a vector function of x, t, u, ux, and uxx of length (num_pde + num_pae). It contains the right-hand sides of the PDEs/PAEs, and assumes that the left-hand sides are all ut only.

pinit is a vector function of x of length (num_pde + num_pae) containing initial conditions for each function in the system.

bc_func is a num_pde by 3 matrix containing rows of the form

  • (bc_left(t) bc_right(t) "D") for Dirichlet boundary conditions, or
  • (bc_left(t) bc_right(t) "N") for Neumann boundary conditions.

    In the case that the PDE for the corresponding row contains second partial derivatives, both left and right conditions are required.

    If only first partial derivatives are present in a particular PDE, then one or the other boundary condition function should be replaced with "NA", and the last entry in the row is always "D".

    If no partial derivatives are present for a PDE, then that row in the matrix is ignored, and can be filled in as ( "NA" "NA" "D").

Notes:

  • The PDEs and PAEs are cast in terms of the solution u, assumed to be a vector of functions. If you are working with a system of PDEs, each row in pde_func will use vector subscripts to index u, e.g. u[0 refers to the first function in the system, and u.x[1 refers to the first derivative of the second function in the system.

  • Algebraic constraints are allowed, e.g., 0 = u2(x) + v2(x) - w(x) for all x

  • The number of boundary functions required matches the order of spatial derivative for each PDE, guaranteeing unique solutions.

  • Only hyperbolic and parabolic PDEs can be solved using numol; for an elliptic equation, such as Poisson's equation, use multigrid or relax.

Launch QuickSheet Example


Obsolete functions

Obsolete functions include:

APPEND

READ

until

WRITE

These functions continue to exist in Mathcad to support backward compatibility, but their use is discouraged.


ODBC Input Component Properties

ODBC Input Component Properties - Data Source tab

You can use the Data Source tab of the ODBC Input Component Properties dialog to specify the data accessed by the ODBC Input component. The following options are available on the Data Source tab:

Select ODBC Data Source

Lists all of the linked databases on your system or network. If the database you want to access is not listed here, you need to establish a link to it.

Authorization

Some databases require you to enter a username and password before granting you access. In order for the ODBC Read component to access the data in a password protected database, you will need to enter a valid username and password for that database. If the database is not password protected, these fields must be left blank.

Select Table

Lists all of the tables in the selected database. You can only access one table per ODBC Read component.

Select Fields

Displays a list of fields in the selected table which will be sent to Mathcad. By default, only field types supported by Mathcad will be listed.

Show fields with unsupported data types

When this box is checked, all fields in the selected table are displayed in the selection box, including fields which Mathcad cannot read.

Select All

Selects all fields in the Select Fields list.

Select None

Deselects all fields in the Select Fields list.

ODBC Input Component Properties - Advanced tab

You can use the Advanced tab of the ODBC Input Component Properties dialog to further control the data returned by the ODBC Input component. The following options are available on the Advanced tab:

Select data using a SQL "where" clause

Allows you to filter your data by means of an SQL Where clause.

Field Order

Use this list to control the order in which the ODBC Input component sends data to Mathcad. Fields are read from top to bottom, and appear in Mathcad running from left to right. You can use the Move Up and Move Down buttons to change a particular field's position in the list.

Include field labels in retrieved data

When this box is checked, the ODBC Input component will add a row of column labels to the data it reads from the database. When accessing the data in Mathcad, the top row will contain the column labels.


Solving Ordinary Differential Equations

odesolve(x,b,[step]) Returns a function of x which is a solution to the single ordinary differential equation (ODE), subject to either initial value or boundary value constraints provided in the solve block. The ODE must be linear in its highest derivative and the number of conditions must be equal to the order of the ODE.

odesolve(vector,x,b,[step]) Returns a vector of functions of x which is a solution to the system of ordinary differential equations (ODEs), subject to either initial value or boundary value constraints provided in the solve block. The ODEs must each be linear in their highest derivatives and the number of conditions must be equal to the sum of the orders of the ODEs.

Arguments:

vector is the explicit vector of function names (with no variable names included) as they appear within the solve block. This argument is omitted in the case of a single ODE.

x is the variable of integration. x must be real.

b is the terminal point of the integration interval. b must be real.

step (optional) is the number of steps used internally when calculating the solution.

Using the function:

Steps for using the odesolve function to solve an ordinary differential equation:

Type the word Given to start the solve block.

Beneath the Given, type the differential equation and its constraints using boolean operators.

Type the odesolve function with the variable of integration, x, and the terminal point b. When solving a system of ordinary differential equations, the vector of functions vector is required as well.

Notes:

  • The differential equation can be written using the derivative operators such as d/dx and d2/dx2 or using prime notation similar to y(x) and y'(x). (The keystroke for the prime character is Ctrl+F7.)

  • The constraints should be give in the form of y(a)=b or y'(a)=b. Mathcad will not accept more complicated constraints such as y'(a)+y(a)=b, although it will accept algebraic constraints, such as y(a) + z(a) = w(a).

  • The terminal point b must be larger then the initial value.

  • By default, odesolve uses a fixed step runge-kutta method of solving. To use an adaptive method, click on odesolve with the right mouse button and choose Adaptive from the pop-up menu. To use a stiff method, click on Odesolve with the right mouse button and choose Stiff from the pop-up menu.

  • To solve systems of differential equations or to solve one that is not linear in the highest derivative term, use rkfixed. If you are using Algebraic constraints, you must choose the Stiff solver from the right-click menu.

  • The first argument vector is optional in the event of single ordinary differential equation (since ordering of the function solutions is an issue only if the numbers of DEs exceeds 1). For example, if the unknown functions are f, g, and h (as named in the solve block), then vector should be explicitly given in the Odesolve call as the column vector:
    f
    g
    h

    Only the function names should appear; do not give the vector as:
    f(x)
    g(x)
    h(x)

    Array subscripts may not be used when naming functions, but literal subscripts are fine. The comments for the single ODE case apply in the multiple ODEs case as well, suitably extended.

Launch QuickSheet Example


ODEsolve and PDEsolve Constraints

The constraints for odesolve and pdesolve can be given in any order but there must be n independent equality constraints for an nth order differential equation. Inequality constraints are not allowed.

For an initial value ODE problem, the values for y(x) and its first n-1 derivatives at a single initial point a are required.

For a boundary value ODE problem, the n equality constraints should prescribe values for y(x) and some derivatives at exactly two points a and b.

For a PDE, there must be an initial condition u(x,0), and n boundary conditions, where n is the order of the PDE, for each unknown function. Boundary conditions can be either Dirichlet (u(x0,t) = f(t)) or Neumann (ux(x0,t)=g(t)), and can be specified at either endpoint of the spatial integration range.

In each case, the endpoints used in boundary conditions must match the endpoints specified in the ode/pdesolve command.

Both Odesolve and Pdesolve allow algebraic constraints of the form y(x) + z(x) + w(x) = 0 or u(x,t) + v(x,t) + w(x,t) = 0. Note that this adds an extra unknown function, w, to the system, which must be specified as one of the output functions in the ode/pdesolve call. Note that, for a system of ODEs with an algebraic constraint, the stiff Radau solver must be used, and will be automatically selected from available methods. To see this, right-click on the Odesolve command.

Mathcad will check the for the correct type and number of constraints and give an error if there is a mistake.


OLE Automation Client

An OLE Automation client is an application in which you can write a program or macro to interact with an object. Microsoft Excel 5.0 or higher, for example, is an OLE Automation client.

If you are not sure an application in an OLE Automation client, check its documentation to find out.


OLE Server

A Windows application capable of exporting OLE (Object Linking and Embedding) objects via the clipboard.

This feature allows you to edit the OLE object using whatever application created it. To do so, double-click on the object.


Only positive values are allowed here.

This value must be zero or a non-negative scalar.

If you’re using a built-in function, click on the function name and press F1 for additional information.


Open-ended Romberg Method

In the open-ended method of integration, the preliminary estimates are obtained by using the midpoints of subintervals, avoiding the necessity to evaluate the function at the endpoints a and b. (See Handheld Calculator Evaluates Integrals, by William Kahan, Ph.D., in Hewlett-Packard Journal, August 1980, for a full description.)

The sample points are concentrated near the ends of the interval of integration, where integrands that are singular or that have an infinite derivative are likely to be changing most rapidly. The number of subintervals is tripled at each step.

For its open-ended Romberg method, Mathcad follows these steps:

  • Calculate an open-ended estimate for the integral by summing terms computed by multiplying the function value at the midpoint of a subinterval by the width of that subinterval. Begin with one interval; the estimate is:

The next estimate uses three points, the next nine points, and so on. Begin by making the first three estimates.

  • Compare the two most recent Romberg estimates according to the following test:

  • If the two most recent estimates agree according to this test, return to the most recent open-ended estimate as the value of the integral. If not, triple the number of subintervals and return to the first step.

There is a set limit on the number of iterations through the open-ended Romberg method. If the routine reaches this limit without returning an answer, the integral is marked with an error indicating that it did not converge.


Opening a Saved as RTF Worksheet with Microsoft Word

When you use Microsoft Word to open an RTF file created with the Save As command from the File menu:

  • The math and graphic regions are no longer editable. They can, however, be moved around freely. Text regions can be edited in Word.

  • If you view as normal, the regions will be aligned along the left margin rather than laid out as they were in the original worksheet. However, by choosing Print Layout from the View menu, you will see them as they appeared in the original Mathcad worksheet.

  • All regions past the right margin will not appear, as Microsoft Word does not have this feature. The margins will be set to Microsoft Word's default margins.


Operand (defined)

Operand

An operand is a number or an expression upon which an operator acts. For example, in the expression "5! + 3" the number "3" and the expression "5!" are operands of the operator "plus." The numbers "5" is an operand of the factorial (!) operator.

The following table gives examples of operands:


Operator

An operator is something that turns one or more numbers into a third number. Examples are:

  • The exponent operator in " [image] "

  • The factorial operator in "(x + z)!",

  • The plus sign in "1 + 1",

  • The integral sign in " [image] ".

The numbers that the operator acts on are called "operands."


Operator Toolbars

The operator toolbars are opened by clicking on the buttons just underneath the menu bar. Clicking on the buttons in these toolbars inserts the corresponding operator.


Operators and Functions for Nested Arrays

Many array operators and functions have no reasonable meaning in the context of nested arrays. For example, it is unclear what matrix multiplication should mean, or what the inverse ought to do.

The following operators and functions, however, continue to have reasonable meanings when used with nested arrays.

Operators

Transpose

Matrix superscript

Vector subscript

Functions

augment

cols

last

length

rows

stack

submatrix


Operators Returned in Symbolic Results

If you chose to save a long symbolic result to the clipboard, you may see the following operators:

ROOTOF

A polynomial may appear on the clipboard in the form

ROOTOF(H(_Z))

where h(_Z) is a polynomial whose root is also a root of the original expression.

D

A “D” stands for the partial derivative operator. The nth derivative is “(D,n)”. The partial derivative of a function with respect to its nth argument is “(D[n])”.

diff

The derivative of f(x) with respect to x is written “diff(f(x),x)”. The nth derivative is “diff(f(x),x$n)”.

int

The integral of f(x) with respect to x is written “int(f(x),x)”.

@

The operator “@” denotes function composition. For example, (sin@exp)(x) is the same as sin(exp(x)). A”@@” represents repeated composition, so (f@@2)(x) is the same as f(f(x)).


Or operator

Or

Keystroke: Ctrl+Shift+6

x [image] y Returns 1 if either x or y are non-zero (true). Returns 0 otherwise.

Operands:

  • x and y are real or complex scalars.

Notes:

  • A value of 0 is FALSE, any non-zero value is TRUE.

  • or first evaluates x, if found to be TRUE (non-zero) y is not evaluated because the or function is already TRUE. Because of this the following give different results:

    • 1 [image] (2/0) = 1 (2/0 is never evaluated)
    • (2/0) [image] 1 gives an error (2/0 causes singularity error)

Launch QuickSheet Example


Order of Operations

In the right-hand worksheet below, an attempt is made to use y before it is defined. Note how y is red. This shows that it is undefined.

y must be defined above and/or to the left of its first use as shown in the left-hand worksheet.


Ordinary Differential Equation (Defined)

Ordinary Differential Equation

An Ordinary differential equation is a differential equation in which the unknown is a function of one variable.


ORIGIN should be an integer...

ORIGIN should be an integer whose magnitude is less than 16 million.

You are trying to define ORIGIN as either non-integer or an integer whose magnitude is greater than 16,000,000.


Output Table Properties: Accumulate

The Accumulate tab is only available in the Inspector component in MathConnex.


Output table properties: Display

Show row/column labels

Click this box to display the row and column numbers associated with the values in the table.

Font

Brings up a dialog box for controlling the font of the displayed numbers.


Output Variable

An output variable is a variable name that is defined as values from another application or data source via a component. An output variable can be a scalar or an array.


Overview of Symbolic Transforms

When you choose Transform from the Symbolics menu, you'll see six additional commands on a pull-right menu. Use these commands to evaluate Fourier, Laplace, and z-transforms, and their inverses.

To transform an expression:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform from the Symbolics menu.

  4. Choose the appropriate transform or inverse transform.

Transforms:

Fourier | Inverse Fourier
Laplace | Inverse Laplace
z | Inverse Z

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.


Page Setup Dialog Box

The Page Setup dialog box contains the following:

Size

The size of the paper in your printer.

Source

The area in your printer supplying the paper.

Portrait

Positions the paper vertically, with the longest dimension running from top to bottom.

Landscape

Positions the paper horizontally, with the longest dimension running from left to right. This is useful if you are printing a worksheet that is wider than a single page.

Left

The distance from the left edge of the physical sheet of paper to the left edge of the print area.

Right

The distance from the right edge of the physical sheet of paper to the right edge of the print area. This appears as a solid vertical line in your window. You may have to scroll to the right to see it.

Don’t mistake the dashed vertical line for the right margin. The dashed vertical line is the right page boundary marking the right edge of the physical sheet of paper. Its location depends on your choice of default printer in your operating system.

Top

The distance from the top edge of the physical sheet of paper to the top edge of the print area. If your worksheet has a header, it appears just above this margin.

Bottom

The distance from the bottom edge of the physical sheet of paper to the bottom edge of the print area. If your worksheet has a footer, it appears just below this margin.

Print single page width

Prints only that which is to the left of the right margin.

Printer...

Provides access your current printer settings.


Parallel Calculations

Any calculation you perform with single values you can also perform with arrays of values. There are two ways of doing this:

  • By iteration over each element using range variables as subscripts.

  • By using the vectorize operator which allows the worksheet to perform the same operation efficiently on each element of a vector or matrix.


Parametric Surface Plots

Parametric surface plots remove the restriction that surfaces be of the form z = f(x,y). With parametric surface plots, you can plot arbitrary surfaces.

  1. Define three matrices of elements to plot. These matrices contain the x, y and z coordinates of the points to be plotted.

  2. Choose Graph / Surface Plot from the Insert menu to a create a surface plot region.

  3. Type ( in the placeholder .

  4. Type the names of the matrices separated by commas.

  5. Type ) .

Notes:

  • All three matrices must have the same number of rows and columns.

  • You cannot convert parametric surface plots into any other type of 3D plot.

Launch QuickSheet Example


Partial Fractions

To expand a rational expression into a sum of fractions with linear or quadratic denominators:

  1. Select the variable you want to use to factor the denominators.

  2. Choose Variable / Convert to Partial Fraction from the Symbolics menu.

This command tries to factor the denominator into factors that are linear or quadratic (with rational coefficients) in the variable you select. If it can't factor the denominator in the selected variable, the expression returns unchanged.

Notes:

  • This command will not expand any expression containing constants with decimal points.

  • When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "convert" keyword and live symbolic evaluation instead.

Launch QuickSheet Example


Paste Special Dialog Box

The Paste Special dialog box has the following options:

Paste

Embeds the copied information into the worksheet. When an object is embedded, changes you make to the object will affect only the copy in the worksheet. The original object is unchanged.

Paste Link

Links the copied information into the worksheet. When you make changes to a linked object, you change both the copy in your math worksheet as well as the original.

This option is available only when an object was copied from a saved file.

Paste As

Specifies how the copied information is pasted into the worksheet. The available options depend on the information you copied.

Display As Icon

Displays the pasted information as an icon. Double-click on the icon to open the object.


Pasting Data from the Clipboard

In some cases, you may have data stored in a spreadsheet or another application, but you don’t want to import or read the data as a file into your worksheet. An alternative to importing a file is to copy the data to the clipboard and paste it into your worksheet. To do so:

  1. Select the data in the other application and copy it to the clipboard. In most applications, you do this by choosing Copy from the Edit menu.

  2. Open the worksheet in which you want the data to be used.

  3. In your worksheet, type a variable definition such as m:=

  4. Click in the placeholder to the right of the := and choose Paste from the Edit menu.

A matrix containing the data you copied appears in the worksheet. Mathcad will attempt to preserve your data types:

  • real numbers will paste as real numbers
  • complex numbers with i or j after them will paste as imaginary
  • numbers with e or E and an exponent will be pasted as engineering notation numbers
  • strings will paste as Mathcad string variables, surrounded by quotes.


Pasting Text

When you choose Paste from the Edit menu, you insert whatever text was last copied or cut. This text goes wherever the cursor is located.


Path to a Reference

For example, to reference a file CONFORM.MCD located in the Mathcad folder, you could type:

c:\program files\mathsoft\Mathcad\conform.mcd

Or, to insert a reference to a file located on the World Wide Web, you could type:

http://www.mathsoft.com/coeffs.mcd


Pathname

A pathname is the complete DOS name for a file. For example, if a file named tuba.txt is in a subdirectory called \orchestra\brass on your A drive, its full pathname is

A:\orchestra\brass\tuba.txt.


Pathnames for Hyperlinks

Examples of Paths for Hyperlinks

c:\program files\mathsoft\Mathcad\conform.mcd creates a hyperlink to the file conform.mcd located in the Mathcad folder.

http://www.mathsoft.com/coeffs.mcd creates a hyperlink to a file located on the World Wide Web.


Payment

pmt(rate, nper, pv, [[fv], [type]]) Returns the payment for an investment or loan based on periodic, constant payments over a given number of compounding periods using a fixed interest rate and a specified present value.

Arguments:

rate is the fixed interest rate at which an investment earns interest per period. rate must be a real scalar. It may be expressed as a decimal such as .0825 or as a percent such as 8.25%.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

nper is the total number of compounding periods per year. nper is a positive integer.

pv is the present value.

fv (optional) is the future value. If omitted fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.


Payment on Interest

ipmt(rate, per, nper, pv, [[fv], [type]]) Returns the interest payment of a investment or loan for a given period based on periodic, constant payments over a given number of compounding periods using a fixed interest rate and a specified future value.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate ³ 0.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

per is the period for which you want to find the interest. per is a positive integer.

nper is the total number of compounding periods. nper is a positive integer. per [image] nper.

pv is the present value.

fv (optional) is the future value. If omitted, fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.

Example:

The interest due in the first month of a 3 year loan of $8,000 with an annual interest rate of 10% is:

ipmt((.10/12),1,36,8000) = -66.67


Payment on Principal

ppmt(rate, per, nper, pv, [[fv], [type]] Returns the payment on the principal of a investment or loan for a given period based on periodic, constant payments over a given number of compounding periods using a fixed interest rate and a specified future value.

Arguments:

rate is the fixed interest rate per period. rate is a real scalar. rate may be expressed as a decimal such as .0825 or as a percent such as 8.25%. rate ³ 0.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

per is the period for which you want to find the interest. per is a positive integer.

nper is the total number of compounding periods. nper is a positive integer. per £ nper.

pv is the present value.

fv (optional) is the future value. If omitted, fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.

Example:

A 10 year home mortgage loan of $100,000 has an annual interest rate of 8.0%. The total principal paid during the first month of the loan is:

ppmt((8%/12),1,120,100000) = 546.61


Solving Partial Differential Equations

Partial Differential Equations in Solve Blocks

pdesolve(u, x, xrange, t, trange, [xpts], [tpts])) Returns a function or vector of functions of x and t that solve a 1-dimensional nonlinear PDE or system of PDEs. Values are interpolated from a matrix of solution points calculated using the numerical method of lines.

Arguments:

u is the explicit vector of function names (with no variable names included) precisely as they appear within the solve block. This argument degenerates to a scalar in the case of a single PDE.

x is the spatial variable.

xrange is a 2-element column vector containing the boundary values for x. Both values must be real.

t is the time variable.

trange is a 2-element column vector containing the boundary values for t. Both values must be real.

xpts (optional) is the integer number of spatial discretization points.

tpts (optional) is the integer number of temporal discretization points.

Using the function:

Steps for using the pdesolve function to solve a partial differential equation:

Type the word Given to start the solve block.

Beneath the Given, type the differential equation and its constraints using boolean operators. Unknown equations must be specified explicitly in terms of their variables, that is, use u(x,t), not just u. Either Dirichlet or Neumann boundary conditions are allowed, as are algebraic constraints, and coupled ODEs.

Subscript notation is used to indicate partial derivatives within the solve block, for example, uxx(x,t) is the second partial derivative of u with respect to x.

Assign the output of the pdesolve function to a function name, or vector of function names.

Notes:

  • pdesolve uses the numerical method of lines to solve partial differential equations. Since no other solving algorithm is supported, no alternative methods are available when you right-click on pdesolve.

  • The numerical method of lines is only appropriate for solving hyperbolic and parabolic PDEs, and partial algebraic equations. If you need to solve an elliptic PDE, such as Poisson's equation, use relax or multigrid.

  • If the unknown functions are f, g, and h (as named in the solve block), then u should be explicitly given in the pdesolve call as the column vector:
    f
    g
    h

    Only the function names should appear; do not give the vector as:
    f(x,t)
    g(x,t)
    h(x,t)

    Neither literal or array subscripts may be used when naming functions, to accommodate the subscript partial differential notation.

Launch QuickSheet Example


Percent

%

Keystroke: %

Description: This is set to 0.01. Use it as a convenient way to work with percent. For example:


Permutations

permut(n,k) Returns the number of ways of ordering n distinct objects taken k at a time. Each such ordered arrangement is known as a permutation.

Arguments:

n and k must be integers greater than or equal to 0.

n must be greater than or equal to k.

Notes:

  • Combinations and permutations are similar since they are both subsets of items. However, internal order is significant in a permutation but not in a combination.

  • The number of permutations is usually denoted [image].

The definition of a permutation is:


pi

Keystroke: p+Ctrl+g or Ctrl+Shift+p

Description: The value of p to 15 decimal digits when used in numerical calculations.

The exact value of p when used in symbolic calculations.


Picture Properties Dialog Box

The Picture Properties dialog box has the following options:

Input

Choose a format for the picture:

Grayscale

RGB Color (red, green, or blue)

HSV Color (hue, saturation, or value)

HLS Color (hue, lightness, or saturation)

Import from Clipboard

Imports a picture from the clipboard. This option is available after you place a picture on the clipboard by copying it from an application.

Output

Choose a format for the section of an image to output:

Grayscale

RGB Color (red, green, or blue)

HSV Color (hue, saturation, or value)

HLS Color (hue, lightness, or saturation)

This option is available only if you check "Output Selected Matrix."

Output Selected Coordinates

Outputs the coordinates for a section of the image that you select. After checking this option, a placeholder appears to the left of the image. Fill in the placeholder with a variable name for the coordinates.

Output Selected Matrix

Outputs the values for a section of the image that you select. After checking this option, a placeholder appears to the left of the image. Fill in the placeholder with a variable name for the output matrix.


Placeholder (defined)

Placeholder

A small black box in a math region is a 'placeholder.' The placeholder indicates that the mathematical expression or plot is incomplete. To complete it, you need to put something appropriate in the placeholder.

To fill the placeholder, click on it and begin typing.


Playback Button

Click this to begin playing the animation. If the animation is already playing, clicking this will stop it.


Playback button for Speed, Image Size, etc.

This brings down a menu allowing you to control playback speed, the size of the image, and various configuration options.

You can also use this menu to open an existing file.


Playback Dialog Box


Playback Window

Click on the various parts of the image below to see what they're for:


Plot Axis Scaling - Autoscale

By default a plot axis is autoscaled.

When this box is checked, autoscale is ON and each axis limit is set to the first major tick mark beyond the end of the data.

When this box is not checked, autoscale is OFF and the axis limits are set right at the data limits.

To turn off autoscale and have your plot drawn to the ends of the plot region:

  • Choose Graph / XY Plot from the Format menu and then click on the autoscale check box for the appropriate axis to toggle it off.


Plot Perspective for a Matrix

In the default perspective, the first row of the matrix extends from the back left corner of the grid to the right, while the first column extends from the back left corner out to the viewer.


Point Options for a 3D Plot

To draw and format the points on a 3D plot:

  1. Double-click on the plot to bring up the 3D Plot Format dialog box.

  2. Click on the Appearance Tab.

  3. In the Points Options section of the Appearance page, use the options to:

    • Draw or remove points

    • Choose a symbol to place at each point

    • Choose a size for the symbols

    • Color the symbols with a solid color or colormap

  4. When you're done, click "Apply" to preview the plot. Click "OK" to dismiss the dialog box.


Pointer

The pointer is what moves around as you move the mouse. It can take many different forms. Click on any of the pictures below for more detail.

To place the cursor

To resize a region

To drag a region

To drag the math expression


Poisson Distribution

Distributions relating to the Poisson equation:

dpois(k, l ) Returns the probability density for the Poisson distribution.

ppois(k, l ) Returns the cumulative probability distribution.

qpois(p, l ) Returns the inverse cumulative probability distribution.

rpois(m, l ) Returns a vector of m random numbers having the Poisson distribution.


Relaxation PDE Solver

Relaxation Method for Partial Differential Equations

relax(a, b, c, d, e, f, u, rjac)

Returns a square matrix in which an element's location in the matrix corresponds to its location within the square region, and an element's value approximates the solution to Poisson's PDE at that point.

Arguments:

a, b, c, d, e are square matrices all of the same size containing coefficients of the differential equation.

f is a square matrix containing the source term at each point inside the square.

u is a square matrix containing boundary values along the edges of the region and initial guesses for the solution inside the region.

rjac is a spectral radius of the Jacobi iteration. This controls the convergence of the relaxation algorithm. It can range from 0 to 1 but its optimal value depends on the details of your problem.

Notes:

  • This function uses the relaxation method to converge to the solution.

  • You should use the relax function if you know the value taken by the unknown function u(x, y) on all four sides of a square region.

  • If the boundary condition is zero on all four sides of the square integration domain, use the multigrid function instead.

  • Poisson's equation

    reduces to Laplace's equation in the case r = 0.

  • If you are trying to solve a hyperbolic or parabolic PDE, or system of PDEs, see Pdesolve.

Launch QuickSheet Example


Multigrid PDE Solver

Multigrid Method for Partial Differential Equations

multigrid(M, ncycle)

Returns a square matrix in which an element's location in the matrix corresponds to its location within the square region, and an element's value approximates the solution to Poisson's PDE at that point for the case where the boundary conditions on all four sides are zero.

Arguments:

M is a 1+2n row square matrix whose elements correspond to the source term at the corresponding point in the square domain.

ncycle is the number of cycles at each level of the multigrid iteration. A value of 2 will generally give a good approximation of the solution.

Notes:

  • If u(x, y) is not zero on all four sides of the square, use relax.

  • Poisson's equation

    reduces to Laplace's equation in the case r = 0.

  • If you are trying to solve a hyperbolic or parabolic PDE, or system of PDEs, see Pdesolve.

Launch QuickSheet Example


Polar Angle Functions

Polar Angles

angle(x,y) This function returns an angle (in radians) between the positive x-axis, and the point (x,y). The value returned is always between 0 and 2p, excluding 2p.

atan2(x,y) Returns the angle (in radians) from the x-axis to a line containing the origin (0,0) and the point (x,y). The value returned is always between -p and p, including p.

Arguments:

Both x and y must be real.

Notes:

The atan2 function is related to the functions atan and arg:

atan2(x,y) = atan(y/x) (although atan returns values between -p/2 and p/2)

atan2(x,y) = arg(x + yi)

Values returned by atan2 (in radians) are always between -p and p, including p.

If the result is positive, the angle is measured counterclockwise from the x-axis.

If the result is negative, the angle is measured clockwise from the x-axis.

See: Converting to degrees.


Polygamma Function


Polynomial Regression

regress(vx,vy,k) Returns a vector which interp uses to find the kth order polynomial that best fits the x and y data values in vx and vy.

interp(vs,vx,vy,x) Returns interpolated y value corresponding to x. You get vs from regress.

Arguments:

  • vx is a vector of real data values. These correspond to the x values.

  • vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

  • vs is a vector generated by regress.

  • k is a positive integer specifying the order of the polynomial you want to use to fit the data. Usually you'll want k < 5.

  • x is the value of the independent variable at which you want to evaluate the regression curve.

Notes:

  • Regress is useful when you have a set of measured y values corresponding to x values and you want to fit a single polynomial of any order to those y values.

  • You should always use interp after using the regress function.

  • Since regress tries to accommodate all your data points using a single polynomial, it will not work well when your data does not behave like a single polynomial. Use the loess function to perform a more localized regression.

  • If you want to fit a surface to x, y, and z data, use regress for multivariate polynomial regression.


Polynomial Regression, Localized

loess(vx,vy,span) Returns a vector which interp uses to find a set of second order polynomials that best fit a neighborhood of the x and y data values in vx and vy. span controls the size of the neighborhood.

interp(vs,vx,vy,x) Returns interpolated y value corresponding to x. You get vs from loess or regress.

Arguments:

  • vx is a vector of real data values in ascending order. These correspond to the x values.

  • vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

  • vs is a vector generated by loess.

  • span is a positive real number for specifying how big a neighborhood you want to use. Use larger values of span when the data behaves very differently over different ranges of x. A good default value is span=0.75.

  • x is the value of the independent variable at which you want to evaluate the regression curve.

Notes:

  • The loess function is useful when you have a set of measured y values corresponding to x values and you want to fit a polynomial to those y values.

  • You should always use the interp function after using the loess function.

  • This function tries to fit different second order polynomials depending on where you are on the curve. It does this by examining the data in a small neighborhood of the point you are interested in. The span argument controls the size of this neighborhood. As span gets larger, loess becomes equivalent to regress with n=2.

  • If you want to fit a surface to x, y, and z data, use loess for multivariate polynomial regression.


Polyroots Function Algorithm

By default, the polyroots function uses a LaGuerre method of finding roots. If you want to use the companion matrix method instead:

  1. Click on the polyroots function with the right mouse button.

  2. Choose Companion Matrix from the pop-up menu.

Launch QuickSheet Example


Pop-up Menu

The menu that appears when you click on a region to select it and then click on it with the right mouse button.


Population Standard Deviation

stdev(A, B, C, ...) Returns the square root of the variance of the values A, B, C, ...

Arguments:

A, B, C, ... are arrays or scalars.

Note:

The stdev function divides by n (the total number of values) rather than n-1 in computing the variance. To find the standard deviation corresponding to a denominator of n-1, multiply the result of this function by the square root of n/(n-1).

Examples:

Other functions for data analysis...

Launch QuickSheet Example


Population Variance Function

Population Variance

Arguments:

A, B, C, ... are scalars or m x n arrays.

Note that this function divides by t, the total number of values rather than t-1 in computing the variance. To find the variance corresponding to a denominator of t-1, multiply the result of this function by t/(t-1).

Other functions for data analysis...


Position

Position refers to whether the text is subscripted, superscripted, or neither.


Postfix Notation

Postfix notation is a way to display a unary operator. In postfix notation, the operator appears after the operand. For example:


Power and Phase Spectrum from FFTs

The fft and cfft functions return the real and imaginary parts of the Fourier transform. You can calculate the power spectrum and the phase spectrum from these by using the vectorize operator.

Power Spectrum, thefrequency distribution of power given by

and Phase Spectrum, the frequency distribution of phase given by

can be calculated efficiently in Mathcad as:

To apply the vectorize operator,

  • Enclose the entire expression between editing lines.

  • Press Ctrl+-

The vectorize operator causes the magnitude operator to return the magnitude of every element in v instead of the magnitude of the vector v itself.


Power Regression

pwrfit(vx,vy,vg) Returns a vector containing the coefficients for a power curve of the form a*xb+c that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

Arguments:

  • vx is a vector of real data values. The values in vx correspond to the x values.

  • vy is a vector of real data values. The values in vy correspond to the y values.

  • vg is a three-element vector of real guess values for the parameters a, b, and c in the power equation:

Note:

vx and vy must have the same number of elements.

Launch QuickSheet Example


Precision in data files

PRNPRECISION (Default = 4)

This represents the number of significant digits to be used when writing to a file with the WRITEPRN function.

To change it, choose Worksheet Options from the Tools menu and go to the Built-in Variables tab.


Preferences Dialog Box (General Tab)

Preferences Dialog Box - General Tab

The following options are available on the General tab in the Preferences dialog box:

Show Mathcad tips at startup

Makes the Tips of the Day dialog box appear when you start the application.

Standard Windows shortcut keys

Sets the keystrokes for certain operations such as Print and Undo to those used in standard Windows applications. When this is not checked, the keystrokes are set instead to those used in previous versions of the application. To see what keystrokes to use at any time, look next to the menu commands in the menu bar.

Context-sensitive equals sign

Allows the = key to insert the evaluation equals sign when it is to the right of a defined variable and the definition symbol (:=) when it is to the right of an undefined variable.

Default Worksheet Location

Sets the directory that the Open and Save As dialog boxes point to the first time after starting the application.

Recently Used Files

Sets the number of recently opened worksheets displayed in the File menu. The default is 4 worksheets.

Undo History

Controls how many actions can be undone. The history length can be set to any number between 20 and 200; the default value is 100.


Preferences Dialog Box (HTML Options Tab)

Preferences Dialog Box - HTML Options Tab

The HTML Options tab allows you to control how Mathcad exports documents to HTML format. Mathcad documents can be saved as either HTML with images for math regions, or as HTML with embedded presentation MathML regions. In either case, documents saved as HTML can be imported back to Mathcad with no loss of functionality (see notes below). These options can also be set on a per-document basis when using Save as Web Page...

The following options are available on the HTML Options tab in the Preferences dialog box:

Save equations as:

Images: If images are chosen, then all equation regions will be displayed as either PNG or JPEG files as selected by the choice below. No additional software is required to display in a browser for this option.

MathML: If MathML is chosen, you can select the style of MathML from the "display using" dropdown menu. Inline MathML will render in browsers that natively support MathML. Other options will generally need a browser plug-in or Active-X component. Check www.mathcad.com for information on current rendering options.

Save images as:

PNG: PNG is lossless, so files may be larger, but will retain more image fidelity.

JPEG: If you select JPEG, you can also set the compression Quality. The higher you set this value, the less images are compressed and the larger the resulting image files will be.

In HTML-only output, all math is exported using the selected image format. In MathML output, only graphs, tables, and components will be output as images.

Save layout as:

Fixed: Fixed positioning uses position absolute tags for styles, mimicking the Mathcad layout but making it hard to add other HTML.

Relative: Relative positioning exports Mathcad content into an HTML table. Relative positioning must be selected to use HTML export templates.

Web page template:

Choose a template file, if desired. Templates will wrap your Mathcad document with additional HTML output, and can only be used if Relative positioning is chosen for layout. They are useful for creating a uniform look and navigation to many Mathcad documents and can be used to create large web sites. See the Author's Reference in the Help menu for additional instructions.

Notes:

All HTML documents saved by Mathcad will embed content MathML in the markup tags. This version of MathML allows a document to be read back into Mathcad. The only exception to this is protected documents, which will not create content MathML, in order to preserve security options.


Preferences Dialog Box (Language Tab)

Preferences Dialog Box - Language Tab

The Language tab allows you to customize how Mathcad handles language- and country-specific settings. All versions of Mathcad allow you to control the spell check dialect; localized (non-English) versions of Mathcad also allow you to control the display of function and unit names, menus, and dialog boxes.

The following options are available on the Language tab in the Preferences dialog box:

Spell Check Dialect pull-down menu

Allows you to specify what dialect the spellchecker should use. Choose American English, British English (-ise), or British English (-ize). British English (-ise) allows spellings such as "realise" and British English (-ize) allows spellings such as "realize."


Preferences Dialog Box (Script Security tab)

Preferences Dialog Box - Script Security tab

The Script Security tab allows you to control how Mathcad handles scriptable components. Scriptable Components can use a scripting language, such as VBScript or JScript, to control the interaction between Mathcad and the underlying application, and may potentially contain harmful code.

The following options are available on the Script Security tab in the Preferences dialog box:

High Security

Automatically disables all scriptable components present in a worksheet when that worksheet is opened. To enable a disabled component, right-click on it and choose Enable Evaluation.

Medium Security

Prompts you when opening a worksheet containing a scriptable component. Clicking on Yes disables all scriptable components in the worksheet.

Low Security

Opens the worksheet with no protection against harmful scriptable components.


Prefix Notation

Prefix notation is a way to display a unary operator. In prefix notation, the operator appears before the operand. For example:


Present Value

pv(rate, nper, pmt, [[fv], [type]]) Returns the present value of an investment or loan based on periodic, constant payments over a given number of compounding periods using a fixed interest rate and a specified payment.

Arguments:

rate is the fixed interest rate at which an investment earns interest per period. rate must be a scalar. It may be expressed as a decimal such that .0825 or as a percent such as 8.25%.

Note: You may need to calculate the interest rate per period. For example to find the interest rate per month based on the annual interest rate, rate = ann_rate/12.

nper is the total number of compounding periods per year. nper is a positive integer.

pmt is the payment made each period. It usually includes principal and interest but no other taxes and fees.

fv (optional) is the future value. If omitted, fv = 0.

type (optional) is 0 for a payment made at the end of the period or 1 for the beginning. If omitted, type = 0.

Notes:

  • Payments you make, such as deposits in a savings account or payments toward a loan, must be entered as negative numbers. Cash you receive, such as dividend checks, must be entered as positive numbers.

Example:

An insurance annuity that costs $50,000 will pay out $500 at the beginning of every month for the next 10 years with the money paid out earning 8 percent. To calculate the present value of the annuity, type the following:

pv((0.08/12), (12*10), 500, 0, 1) = -41485.48

The result is negative because it represents money that you would pay.


Previous Page

Shows the previous page of your worksheet in the Print Preview screen. If this button is gray, there are no previous pages in your worksheet.


Principal Value

In general, every number has n nth roots. For example, there are two equally valid square roots of 4, namely 2 and -2.

Since only one of these values can be returned, there must be a way to choose between them. This is done by picking the principal value, the one with the smallest complex argument. Since the argument of 2 is 0, and that of -2 is [image] /2, the result is 2. By coincidence, this is also a real valued root.


Principal Value of 0.5+.866i

The value 0.5 +.866i is the principal value because it makes an angle of only 60 degrees from the positive real axis. The number - 1, on the other hand, is all the way on the other side, 180 degrees from the positive real axis.


Print

Prints your worksheet.


Print Dialog Box

The Print dialog box contains the following options:

Name

Allows you to choose a printer. By default, output is sent to whatever printer you installed as a default printer. Click on the Properties button to redirect your output to another printer.

Properties button

Brings up a dialog box where you can choose a printer from amongst your installed printers and specify paper size, source, and orientation (landscape or portrait). Consult your operating system documentation for details.

Print to file

Directs your output to a file rather than to a printer.

All

Prints all pages in the worksheet.

Pages

Prints a range of pages. Fill in the “from” and “to” boxes to indicate your selection. If you’ve selected a plotter as your output device, you’ll only be able to print one page.

Selection

Prints only the selected regions. If the button is gray, you have not selected any regions.

Print Current Page

Prints only the active page. The active page is the one on which the cursor is located, and is indicated in the Status Bar. This may not necessarily be the page currently shown in the window.

Number of copies

Specifies the number of copies of the worksheet to print. If this option is gray, your printer may not support this option. Check the printer setup in Windows.


Print Preview Screen Options

Click on the various parts of the screen below to see what they're for:


Printing a Blank Page

Here's an example of a worksheet that would print with a blank page.


Printing a Highlighted Region

If you print a worksheet containing highlighted regions, the appearance of the highlights depends on the printer you are using. Some printers render a color as black, obscuring the highlighted equation. Others render the same color as just the right gray so the highlighted region is not obscured. The color should print in color on a color printer.


Printing from the Help System

To print a topic in the Help system:

  • Navigate to the topic so that it appears in the Help window and click the [image] button.

OR

  • Click with the right mouse button on the topic listed in the Table of Contents and choose Print from the pop-up menu.

Note:

To print all the topics linked to a topic, choose "Print all linked documents" at the bottom of the Print dialog box.


Printing Wide Worksheets

Worksheets can be wider than a sheet of paper. As you scroll horizontally, a dashed vertical line appears on the screen to indicate the right margin. Sections of the worksheet beyond the right margin print on separate pages. You may see blank pages when you print if you print a worksheet that has regions beyond the right margin on only some pages.

To suppress printing of all regions beyond the right margin:

  1. Choose Page Setup from the File menu.

  2. Click on the button beside "Print single page width."

  3. Click "OK."


Probability Density

These give the likelihood that a random variable will take on a particular value.


Processing a Worksheet Containing Errors

A math expression with an error in it is not processed by the worksheet. As a consequence, other errors may appear as a result if the offending variable or result is referenced elsewhere within the worksheet.

For example, if the offending expression is a definition, the variable or function it is supposed to define will remain undefined. This can cause any expressions that reference that variable or function to be undefined as well.


Product with Range Variables

Keystroke: #

Returns the product over i of the expression X.

Operands:

i must be a range of integers.

X is any expression.

If X consists of several terms, be sure to enclose them in parentheses to keep them inside the product operator.

You must define the range variable i before using this operator. For example:

Launch QuickSheet Example


Product Without Range Variables

Keystroke: Ctrl+Shift+3

Returns the product as i goes from m to n of the expression X.

Operands:

i must be an integer.

X is any expression.

m and n must be integers with m < n.

If X consists of several terms, be sure to enclose them in parentheses to keep them inside the product operator.

Note:

The variable i is defined only within the iterated product operator and therefore has no effect on, and is not influenced by, variable definitions outside the product operator.

Launch QuickSheet Example


Programming

Programs make it easy to do tasks that may be impossible or very inconvenient to do in any other way. This is because a program has many attributes associated with programming languages including conditional branching, looping constructs, specifying scope of local variables, error handling, and the ability to call itself recursively.

What is a program

Defining a program

Conditional statements

Program loops

Break operator

Controlling iterations in a loop

Returning a value

Trapping errors

Recursion

Evaluating a program symbolically


Programming Examples

With only ten buttons on the programming toolbar, Mathcad's programming environment is easy to use. Nevertheless, this simplicity conceals a surprising amount of programming power. When combined with Mathcad's rich numerical functionality and used in conjunction with the abstract data structures provided by Mathcad's nested arrays, these ten programming operators enable you to write sophisticated programs in Mathcad.

Mathcad comes with several QuickSheets showing more sophisticated programming techniques including subroutine calls and recursion, which can be accessed from the link below.

Launch QuickSheet Example


Programming Operators

Add Line

local assignment

if

otherwise

for

while

break

continue

return

on error


Programming Toolbar

The Programming toolbar buttons give you quick access to operators used in a program. To learn what a button does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Properties Dialog Box

The Properties dialog box allows you to control the appearance and interaction of selected regions within your worksheet on its Area, Calculation, Display, Protect, and Text tabs. You can set the properties for multiple regions by selecting them and opening the Properties dialog box, but only those tabs applicable to all of the selected regions will be available in the dialog.

Properties Dialog Box - Area Tab

The Area tab controls the appearance of locking and collapsible area boundaries, and contains the following options:

Area name

Enter a name for the area that will appear on the area boundaries.

Line

When this is checked, each area boundary is drawn with a line.

Icon

When this is checked, an icon appears to the left of each area boundary.

Name

When this is checked, the name entered in the Area name text box appears on the area boundaries.

Timestamp (when area is locked)

When this is checked, the date and time at which the area is locked appears on the area boundaries.

Properties Dialog Box - Calculation tab

The Calculation tab allows you some control over the evaluation of a selected region, and contains the following options:

Disable Evaluation

Turns off a region so that it is not processed. Puts a black box next to the region.

Enable Optimization

Turns Optimization on or off for a selected expression. Optimization allows the symbolic processor to simplify an expression before the numerical processor evaluates it.

Properties Dialog Box - Display tab

The Display tab allows you to control how a region appears in your worksheet, and contains the following options:

Highlight Region

Highlights a region with a color.

Choose Color

Allows you to choose a highlight color for the selected region when Highlight Region is checked. To choose a highlight color for all the regions in a worksheet, choose Color Þ Highlight from the Format menu.

Show Border

Adds a border around a selected picture or bitmap.

Display at Original Size

Shows a picture or bitmap at its original size.

Tag

Allows you to assign a name to the selected region. If multiple regions are selected, Tag is grayed out. You can use tags to hyperlink to a specific region in a worksheet.

Properties Dialog Box - Protect tab

The Protect tab allows you to flag the selected region for protection when you select Protect Worksheet... from the Tools menu, and contains the following option:

Protect region from editing

Protecting regions has no effect unless the worksheet is protected. Once the worksheet is Content- or Editing-protected, regions with this checkbox selected cannot be edited.

Properties Dialog Box - Text tab

The Text tab affects how the specified text region interact with other regions in your worksheet, and contains the following options:

Occupy Page Width

Forces a text region to expand to the full width of the page.

Push Regions Down As You Type

Makes a text region push other regions out of its way as it grows, rather than overlap them.


Protect Worksheet Dialog Box

The Protect Worksheet dialog box has the following options:

File

With file-level protection, the worksheet can be saved only as Mathcad 2001i or higher, RTF, Mathcad template (MCT), or as a static HTML file. No restrictions are placed on any regions.

Content

With content-level protection, the worksheet can be saved only as Mathcad 2001i or higher, RTF, Mathcad template (MCT), or as a static HTML file. Existing regions are protected by default and cannot be changed. New regions can be created and protected regions can be copied.

Editing

With editing-level protection, the worksheet can be saved only as Mathcad 2001i or higher, RTF, Mathcad template (MCT), or as a static HTML file. Existing regions are protected by default and cannot be changed. Protected regions cannot be edited or copied. No new regions can be created in the worksheet.

Password

By entering a password, you can restrict the ability to unprotect your worksheet to people with whom you share the password. In order to protect your worksheet with a password, you must enter it correctly twice in the dialog box. Password protection is optional.


QR Decomposition

qr(A) Returns a matrix whose first n columns contain the square, orthonormal matrix Q, and whose remaining columns contain the upper triangular matrix, R. Use the function submatrix to extract these smaller matrices.

Matrices Q and R satisfy the equation [image].

Arguments:

  • A must be either a vector or a matrix.

  • The elements of A must be real.


Quadratic

This option is only available when the Solving and Optimization Extension Pack (Expert Solver) is installed.

Choose this when you are solving a quadratic program and want to apply a quadratic programming method.

Notes:

  • A quadratic program is one in which the objective function contains linear and quadratic terms such as those of the form a*x2 or c*x*y.

  • You need to have guess values in the solve block if you choose the Quadratic option. The guess values are immaterial, however - they have no effect on the solution except when solving for a matrix or vector result. In that case, the guess value for the vector or matrix indicates the size of the vector or matrix to find.

  • The Quadratic option does not use the built-in variable TOL when solving.

For more information on the method behind the Quadratic option, see the solver references.


Quasi-Newton method for solving

The Quasi-Newton method is one of the nonlinear methods to use with the find, minerr, minimize, and maximize functions.

For more information on the Quasi-Newton method, see the solver references.


QuickPlots

2D QuickPlots

Usually when you create an X-Y or polar plot, you need to first define the variable in the expression you are plotting. In a Quickplot, there is no need for these variable definitions.

For example, if you want to plot x versus x^2, you do not need to first define x as a range variable. To create a Quickplot, simply plot x versus x^2. An appropriate range for x is chosen and a graph is created.

3D QuickPlots

When you define a function or a set of functions and graph it, you are creating a QuickPlot.


QuickSheets

QuickSheets are worksheets demonstrating a variety of calculations. To open a QuickSheet, choose QuickSheets from the Help menu. You can search for a QuickSheet on a particular function or operator by using the Search button on the toolbar at the top of the window.


Range Variables and Sequences Values

Some examples are:

1,2..20 gives 1, 2, 3 ...20

20,19,..1 gives 20, 19, 18 ...1

1,1.1..5 gives 1, 1.1, 1.2 ...5

5,3..-7 gives 5, 3, 1, -1 ...-7

To get the double-period, (..) always type the semicolon (;).


Rank of a Matrix

rank(A) Returns the rank of A.

Arguments:

  • A must be either a vector or a matrix.

  • The elements of A should be real.

Launch QuickSheet Example


Reading Data from a Data File (READ Function)

Reading Data From a Data File

READ(“file”) Returns a single entry from file.

Arguments:

file is either the pathname to an ASCII file.

file is entered as a string.

file must contain numbers arranged in columns and separated by tabs or spaces.

READ is usually used in conjunction with a range variable as in:

i := 1 .. N

:= READ(“file.dat”)

This creates an array containing whatever numbers are in file.dat.

The file being read must be an ASCII file containing a list of decimal numbers separated by tabs or spaces. Exponential notation such as

16E-2-16.125E-15

is permitted.

WARNING: This function is provided only for compatibility with old worksheets that may be using it. It is, however, obsolete and its use is not recommended. Instead, you should use the READPRN function to write data to a data file.

See: File Access Functions.


Read Function Filename Argument

This is the name of an ASCII file (in the current working directory) typed as a string (press “). For example:

READPRN(“heights.prn”) reads from the file heights.prn located in the current working directory.

If you want to perform file I/O operations on a file not in the current default directory, you must enter the pathname to the file as a string. For example:

READPRN(“c:\windows\data\heights.prn”) reads from the file heights.prn located in the c:\windows\data directory.


Reading a BMP File as a Color Image

Reading a File as a Color Image

READRGB(“file”) Returns an array consisting of three nxn submatrices. Each element is an integer between 0 and 255. The first n/3 columns represent the red component of image in file. The second and third sets of n/3 columns represent the green and blue components of the same image. The three corresponding matrix elements, when taken together, establish the color of the pixel.

Arguments:

file is either the pathname to a BMP, GIF, JPG, PCX, or TGA file.

file is entered as a string.

The separation of the image into three sets of n/3 columns gives you greater flexibility to manipulate the image before displaying it. Before displaying it however, you should separate it into three separate n column matrices which you can then type, separated by commas, into the placeholder.

Once you have read a file into your worksheet, you can use the picture operator to view it.

Launch QuickSheet Example


Reading a BMP File as a Grayscale Image

READBMP(“file”) Returns an array of integers between 0 (black) and 255 (white) representing a grayscale version of the image in file.

Arguments:

file is either the pathname to a BMP file.

file is entered as a string.

Once you have read a file into your worksheet, you can use the picture operator to view it.

Launch QuickSheet Example


Reading and Writing Complex Data to ASCII Data Files

It is generally good practice to write the real and imaginary parts of a complex number to separate files.

For example, let Z be a complex matrix. Then

WRITEPRN(“z_real.prn”) := Re(Z)

WRITEPRN(“z_imag.prn”) := Im(Z)

To read the data stored this way, do the following:

Z := READPRN(“z_real.prn”) + 1i * READPRN(“z_imag.prn”)


Reading Certain Values from a Data File

By default, when you read data from a data file using the File Input component, the entire data file is read. To read only certain rows or columns:

  1. Insert the File Input component so that it reads from a data file.

  2. Click once on the component to select it.

  3. Choose Properties from the context menu to bring up the Properties dialog box.

  4. Use the dialog box to specify the rows and columns at which to start and stop reading.


Reading Data from a File (defined)

Reading Data from a File

To bring data from an external data file into a worksheet by connecting to the data file. If the data file changes, the data automatically updates in the worksheet.


Reading From or Writing to a Different File

When you use the File Input or File Output components, you specify the file to read from or write to. If you want to read from or write to a different data file or a different type of data file:

  1. Right click on the component and select Properties from the component’s pop-up menu to bring up the Component Properties dialog box.

  2. On the File Options tab, select your file type from the dropdown list of supported data types and browse or type the name of the file you want to open.

  3. You can also revise the Data Range on the Data Range tab by setting new values to start and stop.


Reading the Image into a Matrix

The first step in image processing is to have an image to process. You can do this by reading the image from the disk and into a matrix just as you would read in any data file.

There are two options:

  • Use READRGB or a related function to create a matrix corresponding to a file. For example:

    M     := READRGB(”file”)

  • Use READBMP or a related function to create a matrix corresponding to the grayscale representation of a particular file. For example:

    M     := READBMP(”file”)

Note that the names of the functions must be in UPPERCASE.


Real Fourier Transform

fft(v) Returns the Fourier transform of a vector. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

  • v must have [image] elements (m>2).

  • All elements in v are real.

Notes:

  • This function uses a highly efficient fast Fourier transform algorithm. In order to do so, the vector you use with fft must have [image] elements. For vectors with complex values or with any number of elements, use cfft instead.

  • For 2 dimensional Fourier transforms, use cfft instead.

  • If you use fft to get to the frequency domain, you must use ifft to get back to the time domain.

  • The elements in v must be real because the fft/ifft pair takes advantage of the fact that, for real data, the second half of the transform is just the conjugate of the first. Mathcad discards the second half of the result vector to save time and memory.


Recursion

Recursion is a powerful programming language that involves defining a variable in terms of itself as shown in this example:

Recursive function definitions should always have at least two parts:

  • An initial condition to prevent the recursion from going forever, and

  • A definition of the function in terms of a previous value of the function.

The idea is similar to that underlying mathematical induction: if you can get f(n+1) from f(n), and you know f(0), then you know all there is to know about f.

Keep in mind however, that although recursive function definitions, despite their elegance and conciseness, are not always the most computationally efficient definitions. You may find that an equivalent definition using one of the iterative loops will evaluate more quickly.


Redefining Built-In Constants

Redefining Built-In Math Constants

You can change the value of the constants

infinity

p

e

i

j

%

by using ":=" in your worksheet just as you would for any variable.

See: Redefining built-in system constants.


Redefining Built-In System Constants

You can change the value of the constants

ORIGIN

PRNPRECISION

TOL

CTOL

PRNCOLWIDTH

in two ways:

  • By redefining them with ":=" in your worksheet

  • By choosing Worksheet Options from the Tools menu and going to the Built-in Variables tab.

See: Redefining built-in math constants.


Referenced Worksheet

This must be a worksheet that already exists, either on your drive or on the Internet. For example, to reference a file CONFORM.MCD located in the Mathcad folder, you could type:

c:\program files\mathsoft\Mathcad\conform.mcd

Or, to insert a reference to a file located on the World Wide Web, you could type:

http://www.mathsoft.com/coeffs.mcd

Once the worksheet has been referenced, do not move it to another directory. If you do, your worksheet will not know where to find it. If you plan to move the Mathcad worksheet containing the reference as well as the referenced worksheet, make sure you keep the relative directory structure between the two and make sure the link uses a relative path.


References for solvers

Refer to the following sources for more information on the individual solving methods involved in the solving process behind the functions find, minerr, minimize, and maximize:

Press, W. H., W. T. Flannery, S. A.Teukolsky, and B. P. Vetterling.
Numerical Recipes in C.
Cambridge University Press, New York, 1992.

Polak, E. Optimization – Algorithms and Consistent Approximations. New York: Springer-Verlag, 1997.

Winston, W. Operations Research: Applications and Algorithms. Belmont: Wadsworth, 1994.


Region

Anything you create in your worksheet goes into a 'region.' Procedures for selecting, deleting and moving regions are the same regardless of what's in the region.

When you click in a region, you'll see either a pair of blue editing lines for math regions or the text insertion point, which is red, for text regions. When you click outside a region, you'll see a small crosshair. You can also have graph and image regions.


Relation to hyperbolic functions

Hyperbolic function definitions


Relationship between trig and hyperbolic functions

Relation to trig functions


Relative Path to a Hyperlinked File

Use a relative path if you want the location of the linked file to be stored relative to the Mathcad worksheet containing the link. This allows the link to be valid even if you move the linked file and the main worksheet, but keep the relative directory structure between the two the same. To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, the path may display as a full path but Mathcad uses a relative path internally. If you move the files, the displayed path will change accordingly.


Relative Path to a Referenced File

Use a relative path if you want the location of the referenced file to be stored relative to the worksheet containing the reference. This allows the reference to be valid even if you move the referenced file and the main worksheet, but keep the relative directory structure between the two the same. To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, a capital “R” appears in parentheses at the end of the path for the reference in your worksheet.


Repeated Expression Evaluation using Range Variables

Use range variables to repeatedly evaluate an expression over a range of values as shown below. The expression is evaluated once for each value of the range variable.

If you use two or more range variables in an equation, the equation is evaluated once for each value of each range variable. This is useful when defining matrices:


Replace Dialog Box

The Replace dialog box contains the following:

Find what

Enter the character(s) to find.

Replace with

Enter the character(s) to replace those in the "Find what" box.

Match whole word only

Check this to locate a whole word, rather than part of a word, consisting of the character(s) in the "Find what" box.

Match case

Check this to locate character(s) having the same case as those you enter in the "Find what" box.

Find in Text Regions

Check this to locate character(s) in text regions only.

Find in Math Regions

Check this to locate character(s) in math regions (equations and graph) only.

Find Next

Locates the next or previous occurrence of the character(s) in the "Find what" box.

Replace

Substitutes the character(s) in the "Replace with" box for the currently selected character(s).

Replace All

Substitutes the character(s) in the "Replace with" box for all occurrences of the character(s) in the "Find what" box.


Resizing a Component

To make a component larger or smaller:

  1. Double-click on the component to activate it.

  2. Move the cursor to one of the handles so that the cursor changes to a double-headed arrow.

  3. Press and hold down the mouse button.

  4. Drag the cursor in the direction you want the component’s dimensions to change.


Resizing a Graph

To change the length and width of a graph:

  1. Click on the graph to select it. This encloses it in a selection rectangle. You will see three handles.

  2. Move the pointer to one of the handles at the bottom or right border of the region. It should change to a double-headed arrow.

  3. With the mouse button pressed, move the mouse. The graph will be stretched in the direction of motion.

  4. Once the graph is the right size, let go of the mouse button.


Resizing a Scrolling Output Table

To resize an output table:

  1. Click on the output table. You should see a selection box surrounding the table with anchors on the sides.

  2. Move the cursor to an anchor until it changes to a double-headed arrow.

  3. Hold the mouse button down and move the mouse. The output table will be stretched in the direction of motion.

  4. Once the output table is the right size, let go of the mouse button.


Resizing a Window

With the pointer on the window's edge, press and hold down the mouse button and drag the mouse. When the window is the size you want, release the mouse button.


Restoring the Original Copy of your E-book

To replace the currently open section with the original section from the unmarked copy of your E-book:

  • Choose Restore Section from the Book menu.

To replace the currently open E-book with the original, unmarked copy of your E-book:

  • Choose Restore All from the Book menu.

Note that these will cause you to lose all changes you've ever made to either the currently open section or the currently open Electronic Book.


Restrictions on Left Side of "="

Any variables or functions you use on the left should have been defined earlier.

For example, if type "x + 1 =" and you haven't defined "x" yet, it will be impossible to give you an answer. When this happens, you'll see an appropriate error message.

Certain symbolic functions are not defined for normal Mathcad evaluation, only for symbolic evaluation, and will produce errors when used with =.


Restrictions on Left Side of ":="

You cannot put a number or an expression to the left of the ":=".

Whatever is to the left of the ":=" must be a simple variable name, a subscripted variable, a matrix of variable names, or a function name.


Restrictions on Right Side of "="

You cannot directly edit what appears to the right of the "=". You can, however, change the format or units in which the numbers are displayed.


Restrictions on Right Side of ":="

Any variables or functions you use on the right should have been defined earlier.

For example, if type "y := x + 1 =" and you haven't defined "x" yet, it will be impossible to assign any number to y. When this happens, you'll see an appropriate error message.


Restrictions on Variable and Function Names

A name cannot start with one of the numbers 0 through 9, an underscore ( _ ), a prime symbol `, or a percent ( % ).

The infinity symbol can only appear as the first character in a name.

All characters in a name must be in the same font, have the same pointsize, and be in the same style.

Your worksheet does not distinguish between variable names and function names. Thus, if you define f(x), and later you define the variable f, you will find that you cannot use f(x) anywhere below the definition for f.

Certain names are already used for built-in constants, units, and functions. Although you can redefine these names, keep in mind that their built-in meanings will no longer exist after the definition. For example, if you define a variable called mean, the built-in function mean(v) can no longer be used.

Your worksheet distinguishes between uppercase and lowercase letters. For example, diam is a different variable from DIAM.

Your worksheet distinguishes between names in different fonts. For example, AREA is a different variable than AREA.


Result Format Dialog Box - Display Options Tab

The Result Format dialog box has the following options on the Display Options tab:

Matrix display style

Specifies whether an array is displayed in an output table or in matrix form.

  • Choose "Matrix" to see the result in matrix form.

  • Choose "Table" if you want to see the array displayed in an output table.

  • Choose "Automatic" if you want a table or matrix depending on the size of the array. If the array has more than 10 rows or columns, you see a table. Otherwise, you see a matrix.

Default is Automatic.

Expand nested arrays

Expands nested array notation. For example:

Default is unchecked.

If a nested array is displayed as a table, you can temporarily expand an element by clicking on the table with the right mouse button and choosing Down One Level from the pop-up menu.

Imaginary value

Controls whether computed results having an imaginary part are displayed using 'i' or 'j'.

This setting controls only the display of computed results. You can continue to use either 'i' or 'j' when you enter an imaginary number.

You can set this only when a particular result is not selected. Click in a blank part of your worksheet, then choose Result from the Format menu to bring up the dialog box and set the imaginary value.

Default is 'i'.

Radix

Controls whether a number is displayed as binary (base 2), octal (base 8), hexadecimal (base 16), or decimal (base 10). Default is decimal.

Binary, Hexadecimal, and octal numbers are followed by the letter "b," "h," or "o" respectively so you can readily distinguish them from decimal numbers. (Mathcad does not reliably show hexadecimal or octal numbers of magnitude greater than 2^31.)


Result Format Dialog Box - Number Format Tab

The Result Format dialog box has the following options on the Number Format tab:

Format

Specifies the format scheme:

General - You control the number format by specifying the "Number of decimal places" and "Exponential threshold." Results are in exponential notation when "Exponential threshold" is exceeded.

(exponential threshold is 3)

Decimal - You control the number format by specifying the "Number of decimal places." Results are never in exponential notation.

If there are more than 15 digits to the left of the decimal, Mathcad displays zeros for the remaining digits, but only the first 15 digits are accurate. For example:

12345678901234567890 = 12345678901234568000

Scientific - You control the number format by specifying the "Number of decimal places." Results are always in exponential notation.

Engineering - You control the number format by specifying the "Number of decimal places." Results are always in exponential notation and the exponents are multiples of three.

Fraction - Results display as fractions. You can control whether mixed numbers are used.

Default is General.

Number of decimal places

Controls the number of displayed digits to the right of the decimal point equaling the lesser of "Displayed precision" and [16 minus the number of digits to the left of the decimal point]. This affects only the display. Calculations occur with full precision (up to 16 digits total) no matter how you decide to display the result.

For example, the number .000125 is displayed as follows:

Number of decimal places | Result in Decimal format
2 | 0
3 | 0
4 | .0001
5 | .00013
6 | .000124

The number of decimal places must be between 0 and 15 inclusive. Default is 3.

Show trailing zeros

Controls whether trailing zeros are used to display results with as many digits to the right of the decimal point as required by the current choice of "Number of decimal places."

For example, if "Number of decimal places" is 3, then the following is true:

1.5 | "Show trailing zeros" is unchecked | Displays as 1.5
1.5 | "Show trailing zeros" is checked | Displays as 1.500

If a result has more than 15 digits total and "Show trailing zeros" is checked, Mathcad displays 15 digits followed by zeros until there are as many digits to the right of the decimal point as specified by "Number of decimal places." The exception to this is when General format is selected as the Format scheme. If General is selected and "Show trailing zeros" is checked, Mathcad will not display zeros beyond 15 digits total, regardless of "Number of decimal places." For example:

Number | Format scheme | Settings | Result with "Show trailing zeros" checked
1234567890123.456 | General | Displayed precision = 3 | 1234567890123.46
1234567890123.456 | Decimal | Number of decimal places = 3 | 1234567890123.460
12 | Scientific | Number of decimal places = 3 | 1.200
1.234 | Engineering | Number of decimal places = 4 | 1.2340 x 100

Default is trailing zeros turned off.

Exponential threshold

When General format is selected, controls whether you see a number displayed in exponential notation. Results of magnitude greater than 10n or smaller than 10-n , where n is the exponential threshold, are displayed in exponential notation.

Examples:

The exponential threshold must be between 0 and 15 inclusive. Default is 6. This means that all numbers outside the intervals [.001, 1000] and [-1000,-.001] are shown in exponential notation.

Show exponents as E±000

When either Scientific or Engineering format is selected as the Format and this option is checked, the result is displayed using E notation. For example:

Default is Show exponents as E±000 turned off.

Use mixed numbers

When Fraction is selected as the Format and this option is checked, the result is displayed as a mixed number. For example:

Default is Use mixed numbers turned off.

Level of accuracy

When Fraction is selected as the format, this controls how close the faction approximation is to the decimal value. The higher the accuracy, the closer an approximation. Default is 12.


Result Format Dialog Box - Tolerance Tab

The Result Format dialog box has the following options on the Tolerance tab:

Complex threshold

Controls how much larger the real or imaginary part of a number must be before display of the smaller part is suppressed.

For example, the number 1+0.002i would appear as follows when displayed with different complex threshold values.

Complex threshold | Result
2 | 1
3 | 1+.002i
4 | 1+.002i

Complex threshold must be an integer between 0 and 63. Default is 10. This means that z is shown as pure real if

z is shown as pure imaginary if

Zero threshold

Controls how close a result must be to zero before it is displayed as zero. For example, the number 0.0001215 displayed with different zero tolerance values appears as follows:

Zero Tolerance | Displayed Result
2 | 0
3 | 0
4 | .000125
5 | .000125

The zero tolerance must be between 0 and 307. Default is 15. This means that numbers smaller than [image] will be displayed as zero.

You can set this only when a particular result is not selected. Click in a blank part of your worksheet, then choose Result from the Format menu to bring up the dialog box without selecting a result.


Result Format Dialog Box - Unit Display Tab

The Result Format dialog box has the following options on the Unit Display tab:

Format units

Reformats the unit display to more common notation. For example, sec-1 displays as 1/sec. This option is checked by default.

Simplify units when possible

Displays the simplest unit possible. For example, kg*m/sec2 is simplified to N (newton). This option is checked by default.


Resuming Interrupted Calculations

Occasionally, an equation may take a long time to calculate. Rather than make you wait until the equation calculates to do anything, you can instead press the [Esc] to halt your calculation. When you do, Mathcad stops and flags the region it was calculating with the error:

"You interrupted calculation. To resume, click here and press 'F9'."

To recalculate the marked equation, put the cursor in the equation and choose Calculate Þ Calculate Now from the Tools menu or press [F9].

To recalculate the entire worksheet, put the cursor in the worksheet and press [Ctrl] F9.

If you find yourself frequently interrupting calculations to avoid having to wait for your worksheet to recalculate as you edit, you may want to select manual mode by unchecking calculation from the Tools menu..


Reverse Video

This equation is highlighted in reverse video.

To highlight anything in reverse video, hold the mouse button down and drag the cursor.


Riemann Zeta Function


Right Arrow Movement

In blank space

Moves the crosshair one space to the right. If another region lies immediately to the right, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math

Moves the insertion line one character to the right. If it's already at the end of an expression, the editing lines move out of the expression and turn into a crosshair in the empty space to the right.

In text

Moves the insertion point one character to the right. If it's already at the end of the text, the insertion point moves out of the text and turns into a crosshair in the empty space to the right.

Nudging regions

Moves the selected region(s) one space to the right or if held down, moves more quickly to the right.


Right margin

This appears as a solid vertical line in your window. You may have to scroll to the right to see it.

Don’t mistake the dashed vertical line for the right margin. The dashed vertical line is the right page boundary marking the right edge of the physical sheet of paper. Its location depends on your choice of default printer in your operating system.


Right Margin Lines

This is an amber-colored vertical line in your worksheet. There are potentially two such lines:

  • A dashed vertical line whose placement is controlled by your choice of printer.

  • A solid vertical line whose placement is controlled by choosing Page Setup from the File menu.

As you type into a text region, it continues to grow until it encounters the first of these two vertical lines.


Rkadapt for Slow Changing Solutions

When the solution doesn't change fast, Rkadapt can adapt its step-size to avoid wasting processing time.


Romberg Integration Method

Mathcad computes definite integrals numerically using a Romberg algorithm. The Romberg method accelerates the convergence of a sequence of simple trapezoidal or midpoint approximations to the integral by extrapolating the sequence of estimates and the corresponding subinterval widths.

The Romberg method used by Mathcad makes successive estimates of the value of the integral and returns a value when the two most recent estimates differ by less than the value of the built-in variable TOL.

To compute the integral of f(x) from a to b, Mathcad follows these steps:

  1. Calculate an estimate for the integral using the trapezoidal rule.

  2. Fit a polynomial to the sequence of trapezoidal estimates computed so far and the corresponding subinterval widths. Extrapolate this polynomial to width zero to produce a Romberg estimate for the integral.

  3. Compare the two most recent Romberg estimates according to the following test:

  4. If the two most recent estimates agree according to this test, check also whether estimate n-1 and estimate n-2 also agreed. If they did, then return to the most recent Romberg estimate as the value of the integral. If not, double the number of subintervals and return to the first step.

Mathcad sets a limit on the number of times it will iterate this procedure. If the routine reaches this limit without converging, or if the integrand is singular at one or both of the endpoints of the interval of integration, then Mathcad switches to an open-ended Romberg method. If Mathcad reaches it’s set limit performing this routine without returning an answer, the integral is marked with an error indicating that it did not converge.

Notes about the algorithm:

  • For small values of TOL, the integration may not converge even though the integral has a finite value.

  • Mathcad generally will not be able to integrate functions that have sigularities in the interior of the interval of integration. Functions such as step and sawtooth functions that have large numbers of finite discontinuities may also lead to nonconverging integrals. If you know where singularities in the integrand are, you can often obtain a correct numerical evaluation by splitting the integral into a sum of integrals with these points as limits. A plot of the integrand may help to indicate trouble spots.


Four Subintervals

Because the Romberg integration method divides the interval into four subintervals and then successively doubles the number of points, it can return incorrect answers for periodic functions having periods 1/(2^n) times the length of the interval.

To avoid this problem, divide the interval into two uneven subintervals and integrate over each subinterval separately.


Root Function Algorithm

The root function uses a secant / Mueller method when the 3rd and 4th arguments are not included. When the bracket arguments are included, the Ridder and Brent methods are used.


Ridder and Brent Methods for Finding Roots

When optional 3rd and 4th arguments to the root function are included, the Ridder method is used to find a root. If that method fails to find a root, the Brent method is used.

For more information on the Ridder and Brent methods, see Numerical Recipes in C, Cambridge University Press (1992).


Rotating an Image


Rotating or Spinning a 3D Plot

To rotate a 3D plot using the mouse:

  1. Click in the plot.

  2. Hold the mouse button down.

  3. Drag the mouse in the direction you want the plot to.

  4. Let go of the mouse when it is in the desired position.

To rotate a 3D plot by a specific amount:

  1. Click on the plot with the right mouse button.

  2. Choose Format from the pop-up menu.

  3. Click on the General tab in the dialog box to see the General page.

  4. Make changes to the Rotation, Tilt, and Twist then click "OK" or "Apply."

To put a 3D plot into continuous motion:

  1. Click in the plot.

  2. Hold down the SHIFT key and click the mouse button down.

  3. Drag the mouse in the direction you want the plot to.

  4. Let go of the mouse when it is in the desired position.

The plot spins continuously in the direction you dragged. To stop it, click inside the plot.

Note:

If you make change to equations that affect the plot, it recomputes while it spins.


Rounding a Number

round(z, n) Returns z rounded to n (optional) decimal places. If n is omitted, returns z rounded to the nearest integer (n is assumed to be zero). If n<0, returns z rounded to n places to the left of the decimal point.

Round(z, y) Returns round(z/y)*y.

Arguments:

z is a complex number.

n must be an integer.

y is a real number. For Round, if z has units, then y must also have units. z must be unitless for round.

Examples:


Row-reduced Echelon Form of a Matrix

rref(A) Returns the row-reduced echelon form of A.

Arguments:

  • A must be either a vector or a matrix.

  • The elements of A should be real.


(Rows - 1) must be power of 2.

This matrix must have 2^n rows.


Rows and Columns in an Array


RTF (Rich Text Format)

This is a file format recognized by an increasing number of word processors and other applications. RTF is capable of representing not just simple text but graphics, equations, fonts, and document layout information like page breaks, margins and paragraph formats.


Running Medians

Evaluation of the medsmooth(vy,n) begins with the running median of input vector vy. We'll call this vy'/ The ith element is given by:

It then evaluates the residuals: vr=vy - vy`

The residual vector, vr, is smoothed using the same procedure described in step 1. This creates a smoothed residual vector, vr`.

The medsmooth function returns the sum of these two smoothed vectors:

medsmooth(vy,n) = vy` + vr`.

Note: medsmooth will leave the first and last (n-1)/2 points unchanged. In practice, the length of the smoothing window, n, should be small compared to the length of the data set.


S-PLUS Graph Types

The S-PLUS Graph component lets you create a variety of plot types. To access the different graph types for the component:

  1. Click with the right mouse button on the component and choose Properties from the pop-up menu.

  2. Choose Line Plot, Gui Graph, or Call Graph Script.

  3. Make sure you enter the appropriate arrays in the input variable placeholder of the component. See the documentation that accompanied your copy of S-PLUS for details about the number and type of arrays required for each type of graph.

Line Plot - This default graph type shows one to four traces on a single graph. Each input is interpreted as a matrix with either one column (interpreted as y-values to plot against ), or two columns (interpreted as x- and y-values).

Gui Graph - This graph type supports any of the S-PLUS graphs available through the S-PLUS graphical user interface. For this component, the inputs are interpreted as matrices, which are bound together to get the set of data columns passed to the graph-creation routines. The graph type rendered is specified in the “Axis Type” and “Plot Type” fields. Click “Choose Axis/Plot Type” to open the S-PLUS dialog box for choosing plot types and viewing thumbnail images of the different types.

Note: On Gui graphs, particular inputs can be treated as conditioning variables in order to produce Trellis plots (conditioned, multipanel plots). To do this, click the checkboxes in the Input Variables tab of the Properties dialog box.

Call Graph Script - This graph type supports any commands that generate version 3.3-style S-PLUS graphs. To enter commands, open the Script Editor by choosing Edit Script from the component’s pop-up menu. The script you enter can contain any S-PLUS code, with calls to plot(), points(), etc. to generate one or more graphs. The inputs and outputs and static variables are specified on the Input Variables and Output Variables tabs of the Properties dialog box, just as they are in the S-PLUS Script component (see below). If the script is totally empty, by default the script is defined as plot(in0). The variable graphsheet.name can be accessed within the script to get the name of the graph sheet. When you are finished editing the script, choose Close & Return from the Script Editor’s File menu.

Note: Normally, the plot is cleared before each call to the script to update the graph. If the checkbox “Clear plot before each call” on the Graph Type page of the Properties dialog box is cleared, this is not done. In this way you can collect multiple plots in different pages.


Sample Data Acquisition Component (DAC)

This example shows the user interface of the Data Acquisition component as it might appear in your Mathcad worksheet. In this example, 1000 points of waveform data are being acquired from a PCI-MIO-16E-4 device at a rate of 10000 samples per second. The component has been set to wait for a trigger event before collection, the parameters of which are shown below. The data are being sent to two output variables, v and Dt.

Figure 1: User Interface of Data Acquisition component


Sample Standard Deviation Function

Sample Standard Deviation

Stdev(A, B, C, ...) Returns the square root of the variance of the values A, B, C.

Arguments:

A, B, C, ... are arrays or scalars.

Other functions for data analysis...


Sample Variance Function

Sample Variance

Arguments:

A, B, C, ... are arrays or scalars.

Dividing the squared deviations by the "sample size minus one" rather than the sample size, provides a better estimate for the true population variance.

Other functions for data analysis...


Save as Web Page Options

The Save as Web Page Options dialog contains the following options for controlling how you output HTML pages when using Save as Web Page from the File menu:

The following options are available on the HTML Options tab in the Preferences dialog box:

Save equations as:

Images: If images are chosen, then all equation regions will be displayed as either PNG or JPEG files as selected by the choice below. No additional software is required to display in a browser for this option.

MathML: If MathML is chosen, you can select the style of MathML from the "display using" dropdown menu. Inline MathML will render in browsers that natively support MathML. Other options will generally need a browser plug-in or Active-X component. Check www.mathcad.com for information on current rendering options.

Save images as:

PNG: PNG is lossless, so files may be larger, but will retain more image fidelity.

JPEG: If you select JPEG, you can also set the compression Quality. The higher you set this value, the less images are compressed and the larger the resulting image files will be.

In HTML-only output, all math is exported using the selected image format. In MathML output, only graphs, tables, and components will be output as images.

Save layout as:

Fixed: Fixed positioning uses position absolute tags for styles, mimicking the Mathcad layout but making it hard to add other HTML.

Relative: Relative positioning exports Mathcad content into an HTML table. Relative positioning must be selected to use HTML export templates.

Web page template:

Choose a template file, if desired. Templates will wrap your Mathcad document with additional HTML output, and can only be used if Relative positioning is chosen for layout. They are useful for creating a uniform look and navigation to many Mathcad documents and can be used to create large web sites. See the Author's Reference in the Help menu for additional instructions.

Title:

Specify an HTML title tag for your page, which will appear in the title bar of the browser when viewing the file.

View saved page in browser:

After saving the file, it will be opened using the default system browser.

Notes:

All HTML documents saved by Mathcad will embed content MathML in the markup tags. This version of MathML allows a document to be read back into Mathcad. The only exception to this is protected documents, which will only allow users to save them as plain HTML, to preserve security options.

With the exception of the Title field and the View saved page in browser checkbox, the options in this dialog are the same as those on the HTML Options tab of the Preferences dialog. However, unlike those options, the ones in the Save as Web Page Options dialog are set on a per-file basis, and will override your selections in the Preferences dialog.


Saving a Grayscale Image

To save a grayscale image to disk file, use the WRITEBMP function as follows:

  1. Make sure the matrix containing the image is in the proper format.

  2. Type the following, substituting the name of your matrix and the name of the file you're writing to:

    WRITEBMP(“File”) := M

Note:

The names of the functions must be in UPPERCASE.

Launch QuickSheet Example


Saving a Worksheet For Use in an Earlier Version

In general, worksheets are only upwardly compatible, but you can save a worksheet so that it will open in an earlier version.

To save a worksheet so you can open it with an earlier version:

  1. Choose Save or Save As from the File menu.

  2. In the “Save as type” drop-down list, select the version you'd like to save and provide a file name.

  3. Click “Save.” A message may appear warning you that certain features will not work in an earlier version.

When you open a worksheet saved as an earlier version, you may see an additional warning indicating that certain features are not supported. Features that are only available in the version the worksheet was created in appear as bitmaps in an earlier version and any regions that depend on them issue error messages. Such features may include QuickPlots.


Saving a Worksheet as HTML

To save a worksheet in HTML/MathML format, you'll first want to set your HTML Options Preferences. Once you've selected image, data, and layout formats, do the following:

  1. Choose Save As from the File menu.

  2. In the “Save as type” drop-down list, choose "HTML/MathML File" and provide a file name.

  3. Click “Save.”

The file is saved as an HTML file with embedded content MathML, so it can still be calculated within Mathcad. Text is saved as text with HTML markup. Settings in the Preferences dialog will determine whether equations are be displayed using a MathML renderer plug-in, or as images. All graphs and other regions that cannot be rendered in MathML are saved in either JPEG or PNG format.

When you save your worksheets in HTML/MathML format, you can read them back in to Mathcad with no loss of information. All regions display and calculate as they would if the document was saved in its usual format. The exception to this is for protected worksheets, in which case only static HTML can be saved.

If you have included an HTML template in your Preferences, the template regions will only be visible in the browser window. HTML/Mathcad files read back into Mathcad will only show the original Mathcad regions, stripping off any template information.

Notes:

  • When you save a worksheet in HTML/MathML format, a subdirectory with the name “(filename)_images” is created to contain associated JPEG or PNG files.
  • You can also save worksheets in HTML/MathML format by choosing Save as Web Page... from the File menu. This results in a second dialog, allowing you to change output Preferences at the time the page is saved.


Saving an Image in Color

To save a color image to disk file, use the WRITERGB as follows:

  1. Make sure the matrix containing the image is in the proper format.

  2. Type the following, substituting the name of your matrix and the name of the file you're writing to:

    WRITERGB(“file”):=A

Note:

The names of the functions must be in UPPERCASE.

Launch QuickSheet Example


Saving Changes in Your E-book

Whenever you save changes to an Electronic Book, you have the option of:

  • Saving changes made to the section that's currently open, or ...

  • Saving all changes you've made, even those made in other sections.

To save only those changes made to the currently open section:

  • Choose Save Section from the Book menu.

To save all changes you've made, even those made in other sections:

  • Choose Save All Changes from the Book menu.

Once you've saved a change to an E-book section, you'll see an asterisk on the title bar when that section is open.


Saving the Image

The transformed image will generally be in a matrix. To make this image available to other applications, you need to save it as a file. There are two ways to do this:

  • To save the image in color...

  • To save only grayscale information...


Saving Files Using Microsoft SharePoint

In addition to saving files in stand-alone formats, Mathcad also supports saving files into a Microsoft SharePoint repository. Using SharePoint provides version control and access management for Mathcad worksheets.

When you open a file in a SharePoint repository, you have the option to check out the file or open it read-only. By checking out a worksheet, you can preserve your changes by checking in the file, saving it back into the repository. Files opened read-only cannot be saved back to the repository, though they can be saved outside the repository, such as to your hard drive.

If your worksheet is unpublished, you will be given the option to publish it when you check in your worksheet. Publishing a file in SharePoint makes it visible to users with Author access; until it is published, your file will be invisible to Author users.

For more information on SharePoint, check out the SharePoint web site at http://www.microsoft.com/sharepoint/.

Note:

Mathcad cannot initially save a file into a SharePoint Repository. If you would like to add your file to your repository, you should add it manually. To do so, point your web browser to the document library page for your repository, and click on the Add Document link to add your worksheet or data file.


Scalar (defined)

Scalar

A scalar is a single number, for example 2 or 34+2i. Anything that's not a scalar is either a vector or a matrix.

When something is 'scalar valued,' it returns a scalar as a result. For example, cos(0) is scalar valued because it returns the single number 1. However identity(3) returns a 3x3 matrix. It is therefore not scalar valued, but matrix valued.


Script Editor

The Script Editor shows the basic outline of a script and three subroutines for you to insert scripting code. The arguments Inputs and Outputs to the “Exec” subroutine correspond to the arrays of input and output data the object works with; you use notation like Inputs(0) and Outputs(1) in the body of the subroutine to refer to the first input and the second output. The commands in each section are executed in sequence whenever the Mathcad worksheet is calculated.


Scriptable Object Component Model

The Scriptable Object component predefined objects, properties, and methods that enable you to configure it to work as a component in Mathcad.

Collections

DataValue objects

Global methods


Scriptable Object Component Properties: Scripting Tab

The Scripting tab of the Properties dialog box is used to specify the number of inputs and outputs the Scriptable Object component accepts and provides. It is also used to specify the name of the object being scripted.

Click Edit Script to bring up the Script Editor for scripting the object.


Sample Scripted Object

Sample script

This scripted object accepts two input values and sends out two output values. The input values determine whether the face smiles or winks. The Script Editor window shows a portion of the VBScript code used to configure the object.


Scripting an Object

To script an object:

  1. Insert the Scriptable Object component.

  2. Click once on the component to select it.

  3. Choose Edit Script from the pop-up menu. This brings up the Script Editor.

  4. Choose Close & Return from the Script Editor’s File menu when you have completed your script and want to resume working in the Mathcad worksheet.

Note: To control the name of the scripted object, click on the Scriptable Object component with the right mouse button and choose Properties from the pop-up menu.

The Scripted Object appears in your worksheet.


Secant Method for Finding Roots

Secant/Mueller Method for Finding Roots

The secant and Mueller methods are used for the root function when there are only two arguments (the optional 3rd and 4th arguments are excluded). First the secant method proceeds as follows:

To compute root(f(x),x), Mathcad uses x as the initial guess to find the root of f(x) and follows these steps:

  1. If |f(x)| < TOL, then x is already a root, so return x.

  2. Set n=1. If x is not 0, set h=TOL*x, otherwise, set h=TOL. Make the following definition

  3. Increase n by one. Then compute the straight line connecting the point

  4. Set x sub n to the point where this straight line crosses the zero axis.

  5. If

  6. Otherwise, go back to step 3.

If this secant method fails to find a root, then the Mueller method is used. The Mueller method is a modified version of the secant method.

When no roots are found

There is a limit on the number of calculations that Mathcad will perform in search of an answer for the root function. If it exceeds this limit without returning an answer, the root function is marked with an error.

This error can be caused by any of the following:

The expression has no roots.

The roots of the expression are far from the initial guess.

The expression has local maxima or minima between the initial guess and the roots.

The expression has discontinuities between the initial guess and the roots.

The expression has a complex root but the initial guess was real (or vice versa).

To make the root function converge, try plotting the expression to determine whether or not the expression crosses the x-axis and if so, approximately where it does so. Change your guess value accordingly. You can also trying changing the value of TOL.


Secant/Mueller Method for finding Roots

The secant and Mueller methods are used for the root function when there are only two arguments (the optional 3rd and 4th arguments are excluded). First the secant method precedes as follows:

To compute root(f(x),x), 'x' is used as the initial guess to find the root of f(x) and follows these steps:

  • If |f(x)| < TOL, then x is already a root, so return x.

  • Set n=1. If x is not 0, set h = TOL*x, otherwise, set h = TOL. Make the following definitions:

  • Increase n by one. Then compute the straight line connecting the points

Set x sub n to the point where this straight line crosses the zero axis.

  • If

  • Otherwise, go back to step 3.

If this secant method fails to find a root, then the Mueller method is used. The Mueller method is a modified version of the secant method.

When no roots are found

There is a limit on the number of calculations that will be perform in search of an answer for the root function. If it exceeds this limit without returning an answer, the root function is marked with an error.

This error can be caused by any of the following:

  • The expression has no roots.

  • The roots of the expression are far from the initial guess.

  • The expression has local maxima or minima between the initial guess and the roots.

  • The expression has discontinuities between the initial guess and the roots.

  • The expression has a complex root but the initial guess was real (or vice versa).

To make the root function converge, try plotting the expression to determine whether or not the expression crosses the x-axis and if so, approximately where it does so. Change your guess value accordingly. You can also trying changing the value of TOL.


Seed

The random number generator seed can be set in two ways. You can select Worksheet Options from the Tools menu, and change its value at the start of the worksheet from the Built-in Variables tab, or you can change its value in the body of the worksheet using the Seed function.

Seed(x) Resets the value of Seed to x, and returns the previous value.

Arguments:

In each case, unless noted,

x is a dimensionless integer between 1 and 2147483647.

Each seed value selects a unique sequence of uniformly distributed random numbers.

Notes:

If Seed is called before any random number generator functions, it's return value will be the same as that set in Worksheet options. If Seed is called after a random number generator function, its return value will be the subsequent value of the seed used to calculate the next number in the sequence.


Select a Variable

To select a variable, click to put the editing lines in the variable name.


Selecting All or Part of an Expression

The significance of what you select depends on the specific menu command you use. In most cases, you'll only be transforming whatever is held between the editing lines. In a few cases, you'll be transforming the entire expression but whatever you select is used in some special way. For example, when you differentiate symbolically, you differentiate the entire expression with respect to whatever you select.


Selecting an Expression

To select an expression, click in it and press the Space key until the expression is between the editing lines.

To select a particular subexpression, you may need to insert parentheses before you can select it.


Selecting Everything Between Two Regions

If you want to select everything between two regions:

  1. Select the first region by clicking on it.

  2. Move the pointer over the last region.

  3. Press Shift and click the mouse button.

Do not click the mouse without pressing Shift. Doing so will deselect the region you've already selected.


Selecting Text Character-by-Character

  • Place the insertion point at one end of the selection.

  • Press Shift and an arrow key.

Text characters are highlighted in the direction of the arrow key used.


Selecting Text Line-by-Line

  • Place the insertion point at one end of the selection.

  • Press Ctrl+Shift and the up or down arrow key.

Text is highlighted from the insertion point to the beginning or end of a line.


Selecting Text Regions

To select an entire text region in order to move it:

  1. Click inside the text region. A rectangle with handles appears around the text region.

  2. Place the pointer on the border of the rectangle until the pointer changes to a small hand.

  3. Press and hold down the mouse button. Without letting go of the button, move the mouse. The rectangle outlines of the text region follow the mouse pointer.

  4. When the rectangle outlines are in the position you want, let go of the mouse button.

To select more than one text region, drag the mouse until the dashed selection rectangle encloses everything you want to select.


Selecting Text Word-by-Word

  • Place the insertion point at one end of the selection.

  • Press Ctrl+Shift and the left or right arrow key.

Text is highlighted from the insertion point to the beginning of the current or next word in the direction of the arrow key used.


Selecting Values from an Output Table

To select all the values in an output table:

  1. Click on the table with the right mouse button.

  2. Choose Select All from the pop-up menu.

To select a group of values from an output table:

  1. Click on the first number you want to copy.

  2. While holding the mouse button down, drag the mouse in the direction of the other values you want to copy.

To select all the values in a row or column:

  1. Click on the row or column number shown to the left of the row or at the top of the column.

  2. Select adjacent rows or columns by dragging the mouse across the row or column indices while holding the mouse button down.

After you have selected the values, they will be highlighted in reverse video.


Sending data from Mathcad to Excel

You can send data stored in Mathcad to Excel.

How do you want to send the data?

  • Just once using copy and paste

  • Just once from an array

  • I want a live link to Excel so that if the data changes in Mathcad, it changes in Excel too.

Just once using copy and paste

This method is useful when you have a small amount of data to take out of Mathcad and place into an Excel worksheet. To copy data from Mathcad and paste it into Excel, follow the instructions for copying data to the clipboard.

Just once from a data file

If you have data stored in Mathcad, you can export it into an Excel worksheet. To do so, follow the instructions for exporting data to a data file.

I want a live link to Excel so that if the data changes in Mathcad, it changes in Excel too.

If you have data stored in an array in Mathcad, you can write it out to an Excel worksheet with the File Read/Write component. This component writes out data from Mathcad to an external data file. It also establishes a live connection between Mathcad and the file so that if the data in Mathcad changes, the data is re-written to the data file. To write data to an Excel worksheet this way, follow the instructions for writing data to a data file.


Series Expansion of an Expression

To expand a function or expression in a Taylor or Laurent series around 0:

  1. Select the variable you want to expand around.

  2. Choose Variable / Expand to Series... from the Symbolics menu.

  3. You'll be prompted for an order of expansion. Choose an order (the default is 6, the maximum is 99) and click "OK."

The expanded series will include a term like O(x^6) at the end. If the symbolic processor can't derive a series centered at 0, it will return the function unchanged. To derive a series with a center other than zero, simply translate the variable.

Keep in mind that the Taylor series for a function may converge only in some small interval around the center. Furthermore, functions like sin or exp have series with infinitely many terms (how many depends on the order you select). Thus, when you approximate a function by the polynomial returned by Expand to Series, the approximation will be reasonably accurate close to the center, but may be quite inaccurate for values far from the center.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "series" keyword and live symbolic evaluation instead.


Series Expansion Term Errors

A term such as O(x^6) indicates that the error in using the given terms of the series as an approximation is bounded by a constant times x^6 as x tends to 0.


Shift + Down Arrow Movement

In blank space...

Moves the crosshair down. If another region lies immediately below, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math...

Turns the pair of editing lines into a crosshair outside and just above the expression.

In text...

Moves the insertion point one line down and selects all text between the old and the new locations of the insertion point.


Shift + Left Arrow Movement

In blank space...

Moves the crosshair one space to the left. If another region lies immediately to the left, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math...

Selects more of an expression to the left of the vertical editing line.

In text...

Selects the next character to the left of the insertion point.


Shift + Right Arrow Movement

In blank space...

Move the crosshair one space to the right. If another region lies immediately to the right, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math...

Selects more of an expression to the right of the vertical editing line.

In text...

Selects the next character to the right of the insertion point.


Shift + Tab key Movement

In blank space...

Inactive.

In math...

Jumps to the previous placeholder. If there are no more placeholders, the editing lines jump out of the expression and turn into a crosshair in the empty space to the left.

In text...

Inserts a space.


Shift + Up Arrow Movement

In blank space...

Moves the crosshair up. If another region lies immediately above, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math...

Turns the pair of editing lines into a crosshair outside and just above the expression.

In text...

Moves the insertion point one line up and selects all text between the old and the new locations of the insertion point.


Side by side bar layout button

Side by Side Bar Layout

When this button is clicked, all the bars coming from the same column of the matrix are clustered together side-by-side.


Sign Function (Real)


Sign Function for Real and Complex Expressions


Sign of a complex number

csgn(z) Returns 0 if z=0, 1 if Re(z)>0 or (Re(z)=0 and Im(z)>0), -1 otherwise.

signum(z) Returns 1 if z=0 and z/|z| otherwise.

Arguments:

z is a real, imaginary, or complex number.


Sign of a real number

sign(x) Returns 0 if x=0, 1 if x>0, and -1 otherwise.

Arguments:

x is a real number.


Symbolics - Simplify

Simplifies the selected expression, performing arithmetic, canceling common factors and using basic trigonometric and inverse function identities.


Simplifying an Expression Symbolically

To algebraically simplify all or part of an expression:

  1. Put the subexpression you want to simplify between the editing lines.

  2. Choose Simplify from the Symbolics menu.

The Simplify command performs arithmetic, cancels common factors, uses basic trigonometric and inverse function identities, and simplifies square roots and powers. If the expression can't be simplified further, the Simplify command returns it unchanged.

Notes:

  • When the expression to be simplified includes functions with more than one branch, such as square root or the inverse trigonometric functions, the symbolic processor may return a result that differs in numerical behavior from the original.

  • Note that when you type numbers with decimal points, the symbolic processor returns any numerical results with decimal approximations.

  • When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Simplifying Displayed Units

To reduce a group of units to one unit if possible:

  1. Double-click on the unit to bring up the Result Format dialog box.

  2. Click on "Simplify units when possible" so it becomes checked.

  3. Click "OK."

Example:

becomes the following when simplified:

Note: If you want your worksheet to automatically try to simplify all the units in a worksheet, click "Set as default" in the Result Format dialog box before clicking "Simplify units when possible."


Simultaneous Definitions

You can use arrays to define several variables at once. To do so:

  1. Create a vector or matrix.

  2. Fill in the element placeholders with variable names.

  3. Type ":" to create a placeholder.

  4. Create a vector or matrix having the same number of rows and columns as the vector or matrix on the left side.

  5. Fill in the placeholders with definitions for the variables.

All elements are evaluated on the right hand side before assigning any of them on the left hand side. Because of this:

  • Nothing on the right hand side of an expression can depend on what is on the left hand side.

  • You cannot have a variable appear more than once on the left hand side.

Launch QuickSheet Example


Sine Integral


Singular and Non-singular Matrices

A matrix is singular if its determinant is equal to zero. A matrix is non-singular when its rows are linearly independent. In other words, no row can be a linear combination of the other rows.

Sometimes, a matrix can be almost singular. In other words, there exists a linear combination of the other rows which comes very close to reproducing one of the rows. When this happens, significant difficulties can occur in numerically computing an inverse. A matrix is nearly singular if it has a high condition number.


Singular Value Decomposition

svd(A) Returns one matrix containing two stacked matrices U and V. Use the function submatrix to extract these smaller matrices.

Matrices U and V satisfy the equation [image],

where s is the vector returned by svds(A) .

Arguments:

  • A must be an m x n array, where m [image] n.

  • The elements of A must be real.


Singular Matrix (defined)

Singular Matrix

The matrix must be neither singular nor nearly singular.

A matrix is singular if its determinant is equal to zero. A matrix is nearly singular if it has a high condition number.


Singular Values Function

svds(A) Returns a vector containing the singular values of A.

Arguments:

A must be an m x n array, where m [image] n.

The elements of A must be real.

The results from this function can be used to perform the singular value decomposition of a matrix.


Sinusoidal Regression

sinfit(vx,vy,vg) Returns a vector containing the coefficients for a sine curve of the form a*sin(x+b)+c that best approximates the data in vx and vy. vg contains guess values for the three coefficients.

Arguments:

  • vx is a vector of real data values. The values in vx correspond to the x values.

  • vy is a vector of real data values. The values in vy correspond to the y values.

  • vg is a three-element vector of real guess values for the parameters a, b, and c in the sinusoidal equation:

Note:

vx and vy must have the same number of elements.


Size

Size refers to the size of the characters in points.


Skewness

Arguments:

A, B, C, ... are arrays or scalars. An array M created from the function arguments must have at least three elements.

The standard deviation of M must not equal zero.

Notes:

  • The skewness of a set of values measures the asymmetry about the mean. skew(M)=0 indicates a distribution is symmetric about its mean. skew(M)>0 indicates that most of the distribution is located near the origin and the "tail" extends towards positive values. skew(M)<0 indicates that the tail extends towards more negative values.

  • skew(M)=0 for the normal distribution.

Other functions for data analysis...


Slider Control in Playback Dialog Box

Use the mouse to drag the slider control left or right to go backwards and forwards in an animation.


Slider for Frame-by-Frame Playback

Use this slider as you would use a scroll-bar. You can use this to go forward or backward one or more frames at a time.


Slope and Intercept

slope(vx,vy) Slope of line that best fits data in vx and vy.

intercept(vx,vy) Intercept of line that best fits data in vx and vy.

Arguments:

vx is a vector of real data values. vx is a vector of real data values for the slope function. The values in vx correspond to the x values.

vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

Notes:

  • The slope and intercept functions are useful not only when your data is inherently linear but when it is exponential as well.

  • The equation of the line that best fits your data in vx and vy is y=m.x+b where m is the result from slope and b is the result from intercept.

The example below illustrates how to do linear regression using the slope and intercept functions. For a short-cut function, use line or medfit instead.

Launch QuickSheet Example


Small Hand Pointer

When you see the hand pointer, you’ll be able to drag the region(s) you’ve selected to some other part of the worksheet. To get this pointer:

  • Select one or more regions.

  • Move the arrow pointer to the edge of any selected region. This turns the arrow pointer into a hand.

If you now drag the hand you’ll see the selected regions follow it.


SmartSketch inputs/outputs tab

SmartSketch Inputs/Outputs

Inputs to SmartSketch

Each input is a value in Mathcad sent to SmartSketch. This area specifies the dimensions, variables, or symbols in the SmartSketch drawing which are controlled by the input.

Outputs from SmartSketch

Each output is a value sent from SmartSketch to Mathcad. This area specifies the dimensions, variables, or symbols in the SmartSketch drawing which return output.

Automatic Resizing

Check this box to make a large drawing resize so that it fits the component window in the Mathcad worksheet.


Smooth Systems

Smooth Systems of Ordinary Differential Equations

Bulstoer(y, x1, x2, npoints, D)

Returns a matrix in which: (1) the first column contains the points at which the solution to the ODE is evaluated and (2) the remaining columns contain the corresponding values of the solution and its first n-1 derivatives.

Arguments:

  • y must be a vector of n initial values or a scalar.

  • x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

  • npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows
    (1 + npoints) in the matrix returned by Bulstoer.

  • D is an n-element vector-valued function containing the first derivatives of the unknown functions.

Notes:

  • Bulstoer uses the Bulirsch-Stoer method which will be slightly more accurate than the Runge-Kutta method used by rkfixed.

  • Use the Bulstoer function instead of rkfixed when you know the solution is smooth.

Launch QuickSheet Example


Smoothing Data using a Gaussian Kernel Method

ksmooth(vx,vy,b) Returns an m-element vector created by smoothing using a Gaussian kernel to return weighted averages of the elements in vy.

Arguments:

  • vx is an m-element vector of real numbers. In supsmooth, the elements of vx must be in ascending order.

  • vy is an m-element vector of real numbers.

  • b is the bandwidth of the smoothing window. It should be set to a few times the spacing between x data points.

Notes:

  • This function is most useful when your data lies along a band of relatively constant width.

Launch QuickSheet Example


Smoothing Data Using an Adaptive Method

supsmooth(vx,vy) Returns an m-element vector created by the piecewise use of a symmetric k-nearest neighbor linear least square fitting procedure in which k is adaptively chosen.

Arguments:

  • vx is an m element vector of real numbers in ascending order.

  • vy is an m element vector of real numbers.

Notes:

  • If your data lies scattered along a band whose width fluctuates considerably, you should use this adaptive smoothing function.

Launch QuickSheet Example


Smoothing Data With Running Medians

medsmooth(vy,n) Returns an m-element vector created by smoothing vy with running medians.

Arguments:

  • vy is an m-element vector of real numbers.

  • n is the width of the window over which smoothing occurs. n must be an odd number of elements less than the number of elements in vy.

Notes:

  • This function is the most robust of the fitting functions since it is least likely to be affected by spurious data points.

Launch QuickSheet Example


Soft Page Breaks

A soft page break is a dashed line across the worksheet. Everything below this line prints on a new page.

Soft page breaks are inserted automatically based on your choice of printer. You cannot move soft page breaks other than by changing printers.

For better control over when a new page begins, use hard page breaks instead.


Solution Using Adaptive Step Sizes

Ordinary Differential Equations with Slowly and Rapidly Varying Regions

Rkadapt(y, x1, x2, npoints, D)

Returns a matrix in which: (1) the first column contains the points at which the solution to the ODE is evaluated and (2) the remaining columns contain the corresponding values of the solution and its first n-1 derivatives.

Arguments:

y must be either a vector of n initial values or a scalar.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by Rkadapt.

D is an n-element vector-valued function containing the first derivatives of the unknown functions.

Notes:

  • Unlike rkfixed which integrates in equal size steps to reach a solution, Rkadapt examines how fast a solution is changing and adapts its step-size accordingly. Rkadapt will use nonuniform step sizes internally when it solves the differential equation, but will return the solution at equally spaced points.

Launch QuickSheet Example


Solve Block

A "solve block" refers to a group of steps involved when solving a system of equations, an optimization problem, or a linear programming problem. The steps for these kinds of solving differ slightly, but each involves the word Given, a set of constraints, and a solving function. Collectively, these steps are known as a solve block.

Parts of a solve block:

  1. The word Given. This word must be typed as a variable in a blank part of the worksheet.

  2. A set of constraints (up to 200). The equations and inequalities should be typed using any of the boolean operators except Ctrl+3 (‘not equal to’).

  3. A solving function:

  • Use find or minerr to solve a system of equations.

  • Use maximize or minimize to optimize a function.

  • Use Odesolve to solve systems of ordinary differential equations.

  • Use Pdesolve to solve systems of partial differential equations.

Solve blocks should not contain the following:

  • Range variables.

  • Constraints involving the 'not equal to' operator (Ctrl+3)

  • Other solve blocks. Each solve block can have only one ‘Given’ and one solving function. You can however, define a function like f(x):=Find(x) at the end of one solve block and use this same function in another solve block.

  • Assignment statements using the assignment operator. When typing an equals sign in a solve block, press Ctrl+=.

Note that when solving equations numerically, other steps may be necessary before using a Solve Block:

  • Guess values for the unknown variables may be required.

  • The Maximize and Minimize functions require that you define the function being optimized.

Launch QuickSheet Example


Solving Process

When you use the functions find, minerr, minimize, and maximize, the AutoSelect feature automatically determines the kind of problem you are solving and tries various appropriate solving algorithms to find a valid solution. To see which algorithm was used:

  1. Click on the function with the right mouse button to bring up the pop-up menu.

  2. Autoselect and one of the following methods are checked:

Linear
Nonlinear / Conjugate Gradient
Nonlinear / Quasi-Newton
Nonlinear / Levenberg-Marquardt
Quadratic

AutoSelect is always used by default. This tells the solver to use it's solving process to find a valid solution. If the problem is linear, the Linear method is applied. If Quadratic, the Quadratic method is used. If the problem calls for a nonlinear solver, AutoSelect uses the Conjugate Gradient solver; if that fails to converge, the Levenberg-Marquadt solver; if that too fails, the Quasi-Newton solver.

Although you will most often want AutoSelect turned on, you can choose a specific method from the pop-up menu if necessary.

Notes:

  • To determine whether a solution is valid, most of the solvers use the built-in variable values of TOL and CTOL. CTOL specifies how closely constraints must be met for a solution to be considered valid. TOL specifies how accurate the solution must be. If necessary, you can adjust the values of CTOL and TOL.

  • Using Mathcad, you can solve nonlinear systems of up to 250 variables, linear systems of up to 1000 variables, and quadratic systems of up to 1000 variables.

  • You can used mixed integer programming, which allows you to force solutions to be integers or binary numbers.

  • If you have trouble finding a solution:

    • Try defining TOL or CTOL with larger values.

    • Try a different guess value or add an inequality. Make sure you have provided a complex guess value if you are trying to find a complex solution.

    • Use minerr instead of find to reach an approximate solution.

    • Try adjusting the Advanced Options for a nonlinear solving method.


Solving a System of Equations Symbolically

To solve a system of equations symbolically:

  1. Type the word Given.

  2. Type the equations and inequalities below the word Given.

  3. Type the Find function entering the unknowns as arguments.

  4. Press [Ctrl]. (the control key followed by a period). You see a right arrow.

  5. Click outside the Find function. The results are displayed a vector. They are in the same order as the arguments to the Find function.

The following is an example:

Launch QuickSheet Example


Solving and Optimization Extension Pack

Solving and Optimization Extension Pack (Expert Solver)

The Mathcad Solving and Optimization Extension Pack (Expert Solver) is available from Mathsoft for Mathcad users who need more analytical power when solving equations and optimizing functions. This extension pack replaces the basic solver that ships with Mathcad.

With the Solving and Optimization Extension Pack, you gain additional solving features such as:

  • Quadratic programming support

  • Mixed integer programming support

  • Improved performance for linear and nonlinear solvers

  • The ability to solve larger numerical problems. You can handle problems that have up to 500 nonlinear variables or 1000 linear variables.

  • Report generation

Contact Mathsoft for more information and the availability of the Solving and Optimization Extension Pack (Expert Solver).


Solving Systems of Equations

Find(var1, var2, ...) This returns the values of var1, var2... that satisfy the equations and inequalities in a solve block. If you are solving for n variables, the solve block must have n equations.

Arguments:

var1, var2,... are scalar variables found in the system of equations.

Using the function:

Steps for using the find function to solve a system of equations:

  1. Define guess values for the unknown variables.

  2. Type the word Given to start the solve block.

  3. Beneath the Given, type equalities and inequalities as part of the solve block using boolean operators.

  4. Use the find function.

Notes:

  • When there is one unknown variable, the solution is a scalar. Otherwise the solution is a vector whose first element is var1, second element is var2, and so on.

  • The algorithm for the find function involves a special solving process where an appropriate method is chosen from a group of available methods.

  • You can use the find function like any other function. For example, you can define another function in terms of find. This allows you to call solve blocks from other solve blocks or vary some of the parameters or constants in your system of equations.

Example:

Solving a system of nonlinear equations


Something is wrong with the solve block...

Something is wrong with the solve block used to define this function. It may need a guess value.

You see this error if you evaluate a user function that is defined in terms of a solve block with an error in it.

To fix the error, fix the problem in the solve block. If you evaluate the solve block directly, instead of defining a function with it, you will see a more specific error message.


Sorting Functions

There are three functions for sorting arrays and one for reversing the order of their elements:

sort(v)

Returns a vector with the values from v sorted in ascending order. If v contains complex elements, the imaginary part is ignored.

csort(A,n)

Returns an array formed by rearranging rows of A until column n is in ascending order. If A contains complex elements, the imaginary part is ignored.

rsort(A,n)

Returns an array formed by rearranging columns of A until row n is in ascending order. If A contains complex elements, the imaginary part is ignored.

reverse(v)

Returns a vector in which the elements of v are in reverse order. If v contains complex elements, the imaginary part is ignored.

Launch QuickSheet Example


Space Bar Movement

In blank space...

Moves the crosshair one space to the right.

In math...

Extends editing lines so as to enclose more of the expression within them. Or, if the math does not contain operators, this changes the math region into a text region.

In text...

Inserts a space.


Spacing Between Bars

This controls the spacing between adjacent bars. The percentage that you enter indicates the percentage of the grid that the spacing takes up. As you increase the percentage, the bars become progressively skinnier.


Special Functions

Tcheb(n,x)

Chebyshev polynomial of degree n, of the first kind.

Ucheb(n,x)

Chebyshev polynomial of degree n, of the second kind.

Her(n,x)

Hermite polynomial of degree n.

Jac(n,a,b,x)

Jacobi polynomial of degree n, with parameters a and b.

Lag(n,x)

Laguerre polynomial of degree n.

Leg(n,x)

Legendre polynomial of degree n.

fhyper(a,b,c,x)

Guass hypergeometric function.

mhyper(a,b,x)

Confluent hypergeometric function.

ibeta(a,x,y)

Incomplete beta function of x and y with parameter a.

G( z)

Euler gamma function.

G( a,x)

Incomplete gamma function of degree a.


Special Functions and Syntax Used in Symbolic Results

Symbolic results, in some cases, use special syntax and functions. When evaluating symbolic expressions, either using the Symbolics menu or live symbolic evaluation, you may see special operators and functions that only have meaning under symbolic evaluation. Answers containing these operators can't be evaluated with =, but they can be evaluated with the symbolic evaluation operator, or the choices on the Symbolics menu.

Special numerical functions

arcsec, arccsc, arccot, arcsech, arcscsh, arccoth

g

Catalan's constant

Chi(x)

Ci(x)

csgn(x)

dilog(x)

D(x)

Ei(x)

FresnelC(x)

FresnelS(x)

G(z)

hypergeom(n1, n2..., d1, d2..., z)

Psi(n,x)

Psi(x)

Shi(x)

Si(x)

signum(x)

W(x)

W(n,x)

Zeta(s)

Since the special functions aren't built-in numerical functions, you can't evaluate them directly in the worksheet by pressing =. To find a numerical value for one of these functions, click its name above.

Launch QuickSheet Example


Specialized Functions for Reading Image Files

The specialized functions listed below read images in the following formats: BMP, JPG, GIF, TGA, and PCX.

READ_IMAGE(“file”) Creates an array containing a grayscale representation of the image file.

READ_HLS(“file”) Creates an array in which the color information in file is represented by the appropriate values of hue, lightness, and saturation.

READ_HSV(“file”) Creates an array in which the color information in file is represented by the appropriate values of hue, saturation, and value.

READ_RED(“file”) Extracts only the red component from a color image.

READ_GREEN(“file”) Extracts only the green component from a color image.

READ_BLUE(“file”) Extracts only the blue component from a color image.

READ_HLS_HUE(“file”) Extracts only the hue component from a color image.

READ_HLS_LIGHT(“file”) Extracts only the lightness component from a color image.

READ_HLS_SAT(“file”) Extracts only the saturation component from a color image.

READ_HSV_HUE(“file”) Extracts only the hue component from a color image.

READ_HSV_SAT(“file”) Extracts only the saturation component from a color image.

READ_HSV_VALUE(“file”) Extracts only the value component from a color image.

Arguments:

  • file is the pathname to a BMP, JPG, GIF, TGA, or PCX file.

  • file is entered as a string.

Use these functions in the same way you use the READBMP function to read an image.


Specialized Functions for Writing Image Files

WRITE_HLS(“file”) Creates a color BMP file out of a matrix in which the image is stored in HLS format.

WRITE_HSV(“file”) Creates a color BMP file out of a matrix in which the image is stored in HSV format.

Arguments:

  • file is the pathname to a BMP file.

  • file is entered as a string.

The specialized functions above are used to create color BMP files out of matrices in which the image is stored in HLS or HSV.

Use these functions in the same way you use the WRITEBMP function to write to a file.


Specifying a Solving Method

Specifying the Solving Method

In special situations, you may want to override the automatic solving process behind one of the solving functions: find, minerr, minimize, and maximize. For example, for in-depth analysis purposes, you may want to see the result given by a method other than the one used by default. To do so:

  1. Click on the function name with the right mouse button to see the pop-up menu.

  2. Choose one of the following methods if it is available:


Specular Light

Specular light comes from a particular direction and is reflected off a surface in a particular direction. A specular light usually creates a bright spot on an object. A spotlight is a good example.

Specular light does not greatly affect a graph's appearance. It is useful, however, if you want to make a plot appear shiny. For example, a surface plot filled on the Appearance page for the 3D Plot Format dialog box with only a white specular light shining on it can change fairly drastically when you change the Shininess on the Advanced page.


sph2xyz built-in function

sph2xyz is a built-in function that converts spherical polar coordinates to Cartesian coordinates. For example:

You can use sph2xyz as the fmap argument to CreateMesh or CreateSpace.


Square root operator

Square root

Keystroke: \

Returns the positive square root of x.

Operands:

x must be a scalar.

When x is negative or complex, returns the square root having the smallest argument.


Stacked Bar Layout Button

Stacked Bar Layout

When this button is clicked, all the bars coming from the same column of the matrix are stacked one on top of another.


Stacked Matrices Returned by the svd Function


Stacking Worksheet Windows

Choose Cascade from the Window menu. This stacks the active window over any other open windows without obscuring any of their title bars.


Standard error

stderr(vx,vy) Returns the standard error associated with simple linear regression for the points described by vx and vy. It measures how closely data points are spread about the regression line.

Arguments:

vx is a vector of known x-values. Must have at least three rows.

vy is a vector of known y-values. Must have at least three rows.

Other functions for data analysis...


Static Variables

Static variables used in the S-PLUS Script component are those which keep their values between calls to the script.

To declare static variables:

  • Add the variable names (separated by commas) to the Static Variable Names field on the Input Variables tab of the component’s Properties dialog box.

All static variables are reset whenever the script itself is changed, however.


Steps in the Levenberg-Marquardt Method

The Levenberg-Marquardt method is a quasi-Newton method (a variation on the gradient method). At each step, Mathcad estimates the first partial derivatives of the errors with respect to the variables to be solved to create a Jacobian matrix. Ordinarily, Mathcad can determine the next estimate to make by computing the Gauss-Newton step s for each variable. In matrix notation, Mathcad solves the matrix equation:

In this equation, J is the Jacobian matrix, s is the step to take, and x is the vector of current estimates for unknown variables. For the first step x is the vector of guesses; at each subsequent step, the new x is the old x plus s, the vector of steps. Notice that computing this step involves the Jacobian matrix J.

Computing this step is not always possible. Computing this step fails when the Jacobian matrix cannot be inverted or when there are more constraints than variables to be solved. In these cases, Mathcad adds the additional condition that the following quantity be reduced to a minimum:

Here D is a vector of weight factors computed from the norms of the columns of the Jacobian matrix. In these cases, s is computed to satisfy this minimization criteria as well as solving the Newton equation with the Jacobian .

The Levenberg-Marquardt method does not work when there are fewer constraints than variables. In these cases, Mathcad returns an error.


Stiff Systems

Stiff Systems of Ordinary Differential Equations

Stiffb(y, x1, x2, npoints, D, J)
Stiffr(Y, x1, x2, npoints, D, J)
Radau(y, x1, x2, npoints, D)

Each of these functions returns a matrix in which: (1) the first column contains the points at which the solution to the ODE is evaluated and (2) the remaining columns contain the corresponding values of the solution and its first n-1 derivatives.

Arguments:

y must be either a vector of n initial values or a single initial value.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by Stiffb, Stiffr, or Radau.

D is an n-element vector-valued function containing the first derivatives of the unknown functions.

J is a function which returns the n by (n+1) matrix whose first column contains derivatives and whose remaining rows and columns form the Jacobian matrix for the system of differential equations.

Notes:

  • Stiffb uses the Bulirsch-Stoer method for stiff systems. Stiffr uses the Rosenbrock method. Radau uses the RADAU5 method.

  • An advantage to using Radau is that no symbolic Jacobian input is needed. This is a disadvantage if J is readily available, because having J will tend to increase accuracy.


Stiff Systems (defined)

Stiff Systems

A system is stiff if when expressed in the form:

y=A x

the matrix A is nearly singular

Under these conditions, rkfixed may oscillate or be unstable.


String (defined)

A string is a sequence of characters between double quotes. It has no numeric value. A string, while not limited in size, always appears as a single line of text in your worksheet.

A number string is a string containing characters which constitute a real, complex, floating point, negative, positive, or exponential number. Spaces in number strings are ignored.


String contains the wrong number of characters or the wrong kind of characters.

When performing mixed integer programming (where you force a result to be an integer or a binary number), there must be as many characters in the string argument as there are variables being solved for. The characters must be either "I" for integer, "B" for binary, or "C" for any continuous real number.


Cannot perform this operation on a string.

This operation can not be performed on a string argument.


Structured Data File

A file in which the data is arranged in rows and columns separated by spaces and tabs. For example:

2 2 3

2 8 6

3 6 9

A text header is allowed in the beginning of a file. However, once the READPRN function encounters a number, it assumes the data has begun. Because of this, the text header should contain no numbers, i.e. dates etc.

Data files can contain numbers in E format. For example:

16E-2 -16.125E-15 200 50

are all valid numbers in a datafile.

Data may not be hexadecimal, octal or binary.


Student's t Distribution

Distributions relating to the Student's t Equation:

dt(x,d) Returns the probability density for the t distribution.

pt(x,d) Returns the cumulative probability distribution.

qt(p,d) Returns the inverse cumulative probability distribution.

rt(m,d) Returns a vector of m random numbers having the Student's t distribution.


Style

Style refers to the actual face chosen within the typeface family such as bold, italic, or underline.


Substitution

To replace all occurrences of a variable with another variable, an expression or a number:

  1. Select whatever you want to replace the variable with and choose Copy from the Edit menu.

  2. Select the variable you want to replace.

  3. Choose Variable / Substitute from the Symbolics menu.

This operation can sometimes result in an unwieldy expression. To simplify the result, select it and choose Simplify from the Symbolics menu.

Note that this command only works for replacing a variable with an expression. You cannot use this to replace one expression with another. To replace one expression with another, use the Cut and Paste commands on the Edit menu.

Launch QuickSheet Example


Subtraction operator

Subtraction

Keystroke: -

x - y

Subtracts y from x.

If you find an expression so long that it scrolls off the right of the screen, you may prefer to negate the y and use Ctrl+Enter instead. This inserts

Operands:

x and y are scalars.

x and y must have the same dimensions.


Sum Elements of a Vector

Keystroke: Ctrl+4

v

Returns the sum of all the elements in the vector v.

Operands:

  • v is a vector.

Launch QuickSheet Example


Summation with range variables

Sum with Range Variables

Keystroke: $

Returns the sum over i of the expression X.

Operands:

  • i must be a range of integers.

  • X is any expression.

Define the range variable i before using this operator. For example:

To make a sum with a variable upper limit of summation, use the following example:

If the summand has several terms, be sure to enclose them in parentheses to keep them inside the summation operator.


Summation Without Range Variables

Sum Without Range Variables

Keystroke: Ctrl+Shift+4

Returns the sum over i as i goes from m to n of the expression X.

Operands:

  • i must be an integer.

  • X is any expression.

  • m and n must be integers.

If the summand has several terms, be sure to enclose them in parentheses to keep them inside the summation operator.

Note:

The variable i is defined only within the summation operator and therefore has no effect on, and is not influenced by, variable definitions outside the product operator.

Launch QuickSheet Example


Superscript Operator

Keystroke: Ctrl+6 or press the Superscript button in the Formatting toolbar.

Returns the nth column of the array M. If M has no nth column, you'll see an appropriate error message.

Operands:

M must be an array

n is a scalar. It may not be complex

Keep in mind that all arrays start at 1 by default. For a matrix with 10 columns, n must run between 1 and 10. To change this, choose Worksheet Options from the Tools menu, then go to the Built-in Variables tab and change ORIGIN.

Example:

To get a row from a matrix, use this in conjunction with the transpose operator. For example, to get the first row from a matrix M, type M Ctrl+1 Ctrl+6 1.


Superseding the Order of Evaluation

If you want to define something below and/or to the right of where you use it, you'll have to use the global definition symbol. To insert the global definition symbol, type ~ (the tilde key). It appears as a triple equals (or as an = if you change its appearance).

There are two passes through your worksheet:

  1. The first pass does all assignments involving the global definition symbol. Within the assignments using the global definition symbol there is an order of evaluation: top to bottom and left to right.

  2. The second pass is for doing all assignments involving ':=' and for displaying results and plots. During the second pass, all assignments (including global assignments) are evaluated.

Note:

  • Global assignments never use assignments involving ':=' . If a variable is defined using a ':=' above a global assignment, the global assignment ignores it. Click here for an example.


Supported Data Types

You can read data from and write data to the following types of data files:

  • Formatted Text (*.prn)

  • Tab Delimited Text (*.dat, *.txt)

  • Comma Separated Values (*.csv)

  • MATLAB MAT Files (*.mat)

  • Excel Files (*.xls)

  • Lotus 1-2-3 Files (*.wks, *.wk1, *.wk*)

  • Quattro Pro Files (*.wq?, *.wb?)

  • dbase Files (*.dbf)

  • S-Plus Files

  • Text files using a comma as the decimal symbol

Note: To read from or write to a text file using a comma as the decimal symbol, verify that the options for your operating system specify the comma as the decimal symbol. Then click "Use comma as decimal symbol" in the dialog box as you choose the file type.


Supported Scripting Languages

The latest versions of Microsoft JScript (JavaScript) and Microsoft VBScript (Visual Basic Scripting Edition) are examples of supported scripting languages. For more information on these scripting languages and to download the latest versions of them, refer to Microsoft, Inc.’s Web site, http://msdn.microsoft.com/scripting.


Symbolic Differentiation

To differentiate a function with respect to a variable:

  1. Press ? to create the derivative operator.

  2. Enter the expression to differentiate and the variable of differentiation in the placeholders.

  3. Press Space until the entire expression is between the editing lines.

  4. Choose Simplify from the Symbolics menu.

To evaluate higher order derivatives, press Ctrl+Shift+? to create the higher order derivative operator follow the instructions above.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Symbolic Display Format

Choose Evaluation Style from the Symbolics menu to control where symbolic results are placed. You'll be able to choose from the following:

  • "vertically, inserting lines" stacks results, clearing a space across the full width of your worksheet.

  • "vertically, without inserting lines" stacks results but leaves adjacent regions in place so that you can do separate calculations side by side.

  • "horizontally" puts results to the right of the original expression

Check the box next to "Show comments" box to automatically insert an appropriate comment before each result. You'll be able to edit these automatically generated comments just as you would any text region.

Check the box next to "Evaluate in Place" to replace the original expression with the symbolic answer. This option is convenient if you want to transform only a part of a larger expression.


Symbolic Equal Sign

Symbolic Equal Sign [Ctrl].

To use the symbolic equal sign to simplify an expression:

  1. Enter the expression you want to simplify.

  2. Press [Ctrl]. to see a right-facing arrow.

  3. Click outside the expression or press Enter. You see the transformed expression to the right of the arrow.

Other facts about the symbolic equal sign:

  • It is a live operator meaning that if you make a change anywhere above or to the left of it, the result is updated.

  • It “knows” about previously defined functions and variables and uses them wherever appropriate. You can force the symbolic equal sign to ignore prior definitions, however.

  • It applies to an entire expression. You cannot, for example, use the symbolic equal sign to transform part of an expression.


Symbolic Integration

To evaluate an indefinite integral:

  1. Press Ctrl+I to create the indefinite integral operator.

  2. Fill in the placeholders for the integrand and the integration variable.

  3. Press Space until the entire integral is between the editing lines.

  4. Choose Evaluate Þ Symbolically from the Symbolics menu.

To evaluate a definite integral instead, press & to create the definite integral operator and follow the instructions above. The symbolic processor will find an indefinite integral and subtract its value at the lower limit of integration from its value at the upper limit. If you use decimals in the integrand or limits of integration, you'll see a 20-place numerical approximation if one is available.

If an integral has no closed form expression, you'll see an appropriate error message. If all you need is a numerical approximation to a definite integral, try evaluating the integral numerically instead.

When evaluating an indefinite integral, remember that the answer to an integration problem is not unique. If f(x) is an integral of a given function, so is f(x) + C for a constant C.

Note:

  • When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Symbolic Matrix Determinant

To evaluate the determinant of a square matrix:

  1. Click on the square matrix and press Space until the matrix is held between the editing lines.

  2. Choose Matrix / Determinant from the Symbolics menu.

Note that you must select the entire matrix to use this command. You cannot define a variable as a matrix and select the variable.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Symbolic Matrix Inverse

To evaluate the inverse of a square matrix:

  1. Click on the square matrix and press Space until the matrix is between the editing lines.

  2. Choose Matrix / Invert from the Symbolics menu.

You must select the entire matrix to use this command. You cannot define a variable as a matrix and select the variable.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


Symbolic Matrix Operations

You can symbolically evaluate matrix expressions involving operators. Most matrix functions will also be simplified symbolically when it is reasonable to do so. To symbolically evaluate an expression involving matrices, matrix operators and functions:

  1. Click on the expression and press Space until whatever you want to evaluate is between the editing lines.

  2. Choose Simplify from the Symbolics menu.

Note that many of these transformations do not apply to the matrix as a whole. For example, to simplify the expressions in a matrix you must select each element and choose Simplify.


Symbolic Matrix Transpose

To evaluate the transpose of a matrix:

  1. Click on the matrix and press Space until the matrix is between the editing lines.

  2. Choose Matrix / Transpose from the Symbolics menu.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


You must evaluate this operator symbolically. Press [Ctrl] [Period].

You have tried to evaluate an expression numerically when it must be evaluated symbolically. When using operators such as the indefinite integral and the limit operators, you must select the expression and choose Simplify from the Symbolics menu.


Symbolic results too long to display

When a symbolic result is too unwieldy to be displayed conveniently in your worksheet, you'll see a dialog box asking you if you want the result placed on the clipboard. Large results are often generated by

  • integrating or differentiating complex expressions

  • finding roots of polynomials symbolically

  • symbolically evaluating functions that produce a very large integer result

If you save a large answer to the clipboard, you can examine the result by opening the clipboard. Symbolic results on the clipboard appear in a syntax similar to what you might see in a spreadsheet.

You can print this result by pasting it into any word processor. You can also paste the answer string directly into your worksheet as a text region.


Symbolic Simplification

For example, when you do symbolic math:

3x - 2x

will simplify to x

If you do numerical math (by simply typing an equal sign) you'll see either:

  • an error message, if x is undefined, or

  • the value of x, if x is defined.


Symbolic Sums and Products

To evaluate sums and products symbolically

  1. Create the summation or product operator by pressing Ctrl+Shift+4 or Ctrl+Shift+3 respectively.

  2. Fill in an expression and a range.

  3. Choose Simplify from the Symbolics menu.

If the symbolic processor can't find a closed form for the sum or product, it either

  • returns an explicit sum or product or

  • returns a message indicating that no closed from was found for the sum or product.

Note:

When you use symbolic commands such as Simplify, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use live symbolic evaluation instead of the menu commands.

Launch QuickSheet Example


The Symbolic Keyword Toolbar

Instead of typing a keyword, you can use a keyword button in the Symbolic toolbar. Click on the [image] button in the Math toolbar to bring up the Symbolic toolbar:

The buttons on the Symbolic toolbar insert the symbolic equal sign and symbolic keywords. Delete any placeholders that are for optional arguments you aren't going to use. Click the Modifiers button to bring up the Modifier toolbar.

To learn what a button on the toolbar does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


Symbolics - Collect

Collects terms containing like powers of the selected subexpression. The subexpression may be a single variable or a function together with its argument. The result is a polynomial in the selected subexpression.


Symbolics - Evaluate - Complex

Carries out symbolic evaluation and returns result in complex form whenever possible.


Symbolics - Evaluate - Floating Point...

Carries out symbolic evaluation, returning a number as the result whenever possible. Brings up the Floating Point Evaluation dialog box where you can specify the number of significant digits the result should have.


Symbolics - Evaluate - Symbolically

Carries out symbolic evaluation of definite integrals, derivatives, summations, products, functions and other algebraic and matrix expressions.


Symbolics - Evaluation Style...

Controls where symbolic results are placed. Options are to:

  • Place result below selected expression, with or without a commentary.

  • Place result to the right of the selected expression, with or without a commentary.

  • Replace the selected expression with the result.


Symbolics - Matrix - Determinant

Returns determinant of the selected square matrix.


Symbolics - Matrix - Invert

Returns inverse of the selected square matrix.


Symbolics - Matrix - Transpose

Swaps rows and columns of the selected matrix.


Symbolics - Polynomial Coefficients

Finds coefficients of an expression when rewritten as a polynomial in a selected subexpression.


Symbolics - Transform - Fourier

Evaluates Fourier transform of an expression with respect to the variable you select within it.


Symbolics - Transform - Inverse Fourier

Evaluates inverse Fourier transform of an expression with respect to the variable you select within it.


Symbolics - Transform - Inverse Laplace

Evaluates inverse Laplace transform of an expression with respect to the variable you select within it.


Symbolics - Transform - Inverse Z

Evaluates inverse z-transform of an expression with respect to the variable you select within it.


Symbolics - Transform - Laplace

Evaluates Laplace transform of an expression with respect to the variable you select within it.


Symbolics - Transform - Z

Evaluates z-transform of an expression with respect to the variable you select within it.


Symbolics - Variable - Convert to Partial Fraction

Generates a partial fraction expansion for an expression. If such an expansion is found, the denominators are linear or quadratic in the selected variable.


Symbolics - Variable - Differentiate

Differentiates the entire expression with respect to the selected variable. Other variables are treated as constants.


Symbolics - Variable - Expand to Series...

Derives a power series for an expression with respect to a variable you select in that expression. A dialog box allows you to choose the order of the series.


Symbolics - Variable - Integrate

Integrates the entire expression with respect to the selected variable.


Symbolics - Variable - Solve

Finds the value of the selected variable that makes the expression containing it equal to zero.

If you select a variable in an equation or inequality, this command solves the equation or inequality for the selected variable.


Symbolics - Variable - Substitute

Replaces all occurrences of the selected variable with whatever is on the clipboard.

To use this menu command:

  1. Cut or copy the expression you want to replace the variable with.

  2. Click on the variable you want to replace and choose this menu command.


Symbolics Menu Commands

Symbolics Menu Command

Evaluate - Symbolically

Evaluate - Floating Point...

Evaluate - Complex

Simplify

Expand

Factor

Collect

Polynomial Coefficients

Variable - Solve

Variable - Substitute

Variable - Differentiate

Variable - Integrate

Variable - Expand to Series...

Variable - Convert to Partial Fraction

Matrix - Transpose

Matrix - Inverse

Matrix - Determinant

Transform - Fourier

Transform - Inverse Fourier

Transform - Laplace

Transform - Inverse Laplace

Transform - Z

Transform - Inverse Z

Evaluation Style


Syntax Error

Usually the result of applying a symbolic operation to an inappropriate or incorrectly typed expression. Symbolic processing of expressions with units will also generate this error.


System of Difference Equations

The following example shows how to generate a coupled set of difference equations:

Launch QuickSheet Example


Systems of Ordinary Differential Equations

rkfixed(y, x1, x2, npoints, D)

Returns a matrix in which the first column contains the points at which the ODE solution is evaluated and the remaining columns contains the corresponding values of the ODE solution(s) and its first n-1 derivatives. A fourth-order Runge-Kutta method is used.

Arguments:

  • y must be either a vector of n initial values or a single initial value.

  • x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

  • npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by rkfixed.

  • D is an n-element vector-valued function containing first derivatives of unknown functions.

Notes:

  • You can use rkfixed to solve a single differential equation or a system of differential equations.

Launch QuickSheet Example


Tab Key Movement

In blank space...

Moves the crosshair to the right, to the next tab stop.

In math...

Jumps to the next placeholder. If there are no more placeholders, the editing lines jump out of the expression and turn into a crosshair at the next tab stop to the right.

In text...

Moves the editing lines to the right, to the next tab stop; any text to the right of the editing lines is moved accordingly. If the editing lines are at the end of the text region, the region is extended to the next tab stop.


Setting Tab Stops

To use the Paragraph Format dialog box to set tab stops:

  1. Select text within the paragraph(s).

  2. Choose Paragraph from the Format menu.

  3. Click the "Tabs" button to open the Tabs dialog box.

  4. Enter numbers into the "Tab stop position" text box.

  5. Click the "Set" button for each tab stop. The number should then appear in the box below the "Tab stop position" text box.

  6. To remove a tab stop, select the tab stop you want to remove in the Tabs dialog box, and click "Clear".


Taylor or Laurent Series

  • Taylor series (series in nonnegative powers of the variable) are applied to functions that are analytic at 0.

  • Laurent series are applied to functions that have a pole of finite order at 0.


Template

A file on which a worksheet is based. A template contains customized information for laying out and formatting the worksheet. The default file extension for templates is “*.mct” and you can create new templates using the Save As command from the File menu.

Note that Mathcad worksheet templates are different from Mathcad HTML templates.


Template Specifics

A template specifies the following:

  • Default text properties

  • Definitions of all math styles

  • Definitions of all text styles

  • Headers and footers

  • Margins for printing

  • Numerical result formats

  • Values for built-in variables

  • Names of basic units

  • The default unit system

  • The default calculation mode


Termination Criteria

The Levenberg-Marquardt method ends when it reaches one of the following termination criteria:

  • When it is no longer possible to reduce the norm of the error vector significantly. In this context, “significantly” means by more than the larger of TOL and TOL*|err_vector|. This criterion stops the solver when the errors cannot be reduce further.

  • When s becomes relatively close to zero. In this method, “relatively close” means a norm smaller than the larger of TOL and TOL*|v|. This criterion stops the solver when there is no preferred direction to move the guesses.

When it reaches one of these termination conditions, Mathcad checks the magnitude of the error vector and returns an answer:

  • If the magnitude of the error vector is less than or equal to TOL, Mathcad returns the variable values as a solution.

  • If the solve block ends with the find function and the magnitude of the error vector is greater than TOL, Mathcad marks the find function with an error.

  • If the solve block ends with the minerr function and the magnitude of the error vector is greater than TOL, Mathcad returns the solution anyway, even though the error vector is not close to zero. Mathcad sets the value of the variable ERR to the magnitude of the error vector.

There is a limit on the number of calculations that Mathcad will perform in search of an answer for a solve block. If it exceeds this limit without returning an answer, the find or minerr is marked with an error.

Mathcad returns an error indicating that no solution was found when the difference between successive approximations to the solution is greater than TOL and any of the following:

  • The solver reaches a point where it cannot reduce the error any further. Try defining TOL with a larger value. Also make sure you have provided complex guess values if you are trying to find a complex solution.

  • The solver reaches a point from which there is no preferred direction. Try different guess values or add an inequality.

  • The solver reaches the limit of its accuracy. Roundoff errors make it unlikely that further computation would increase accuracy of the solution. This often happens if you set TOL to a value below 10^15.


Text Box

This is the rectangular box surrounding a text region when the insertion point is inside it. When you click outside of a text region, the text box disappears.


Text Insertion Point

text insertion point

Where can it appear?

How do you make it appear?

How do you move it around?

What's it for?


Text Region

A rectangular area reserved for typing text. A text region can have any width and be placed anywhere in the worksheet.


Text Region Properties

Setting the width of a text region

Controlling the behavior of a growing text region


Text Styles (defined)

Text Styles

A text style is a tag used to assign text fonts and paragraph properties to text within a paragraph. By default, text uses the default “normal” text style with a particular choice of text and paragraph properties.


Text Styles Dialog Box


The elements in this vector must be in increasing order.

The values in this vector must be in ascending order. Type the name of the vector and press ‘=’ to verify what values are in the vector.

The first argument of lspline, pspline, cspline, linterp, and hist, as well as the second argument of interp, must be a vector whose elements are strictly increasing.


The Error Vector

The MINPACK algorithm attempts to find the zeros of, or at worst minimize the sum of square of, the value of a vector of functions relative to the values of certain variables. The vector of functions Mathcad uses is an error vector whose elements represent the errors in the constraints. The errors are defined as follows:
  • For equality constraints (constraints using “=”):

  • For inequality constraints:

if inequality is true, otherwise:

Mathcad treats the Levenberg-Marquardt algorithm as an algorithm on real variables. When you solve for a complex variable, Mathcad treats the real and imaginary parts as separate variables in the algorithm. When you solve an equality constraint, Mathcad creates two real constraints for the algorithm, one for the real part and one for the imaginary part.


This expression is incomplete. You must provide an operator.

You have not filled in the operator placeholder (an empty box) that is required between two operands. This can occur if you have deleted an operator.

You must insert an operator into the operator placeholder. To do so:

  1. Position the insertion line to the left of the operator placeholder.

  2. Enter an operator by typing its keystroke or clicking on an operator button on a toolbar.

Note: If you want to delete an operator and its operand, delete the operand completely and then delete the operator. Then the operator placeholder does not appear.


The expression to the left of the equal sign cannot be defined.

Something other than a legally definable expression is on the left side of this definition. You can place any of the following on the left side of a definition:

  • A variable name.

  • A variable name with a subscript.

  • A variable name with a superscript.

  • An explicit vector or matrix generated by having chosen Matrix from the Insert menu. The vector or matrix can hold variable names or subscripted variable names only.

  • A function name with arguments: f(x,y).

Any other expression is illegal. If you want to compute a result instead of defining a variable, press the equals sign '=' instead of a colon.


Trapezoidal Estimates

The first trapezoidal estimate is:

The second trapezoidal estimate doubles the number of subintervals, using two subintervals each of width b-a/2. To begin the algorithm, compute the first three estimates, subdividing the interval into one, two, and four subintervals, respectively.


This function has too many arguments.

The indicated expression contains a function with more than the required number of arguments.

For built-in functions, click on the function name and press F1 to see the correct number and types of arguments. For functions you defined, check the definition.


The matrix dimensions are incompatible.

The number of rows or columns do not match.

This message flags a function or operator that requires two matrices having a certain number of rows and columns. If you’re using a built-in function, press Shift+F1 and click on the function name to determine what size matrices are necessary.


The number of bits per pixel must be 8 or 16.

You entered an invalid argument for type when either writing to or reading from a binary data file. Check that the argument you entered is allowed.


The number of rows and columns do not match.

The number of rows and/or columns in these arrays do not match.

You tried to perform a vector or matrix operation on arrays whose sizes are inappropriate. For example, adding two unequal size matrices is illegal. Matrix multiplication requires that the number of columns in the first matrix match the number of rows in the second.


The Romberg Estimate

The variable name Estimate subscripted with 0, 1, and so on represent the internal approximations to the answer. Only the last estimate, the one that passes the tolerance test, is available to the user.


The Standard Form of a Differential Equation

The most important step in “prepping” a differential equation for Mathcad’s differential equation solvers is to get it into standard form which Mathcad’s differential solvers understand. The process is to take a differential equation and get rid of any higher order derivatives that appear, leaving only first derivatives. Your differential equation is then a system of first order differential equations.

For example, the differential equation:

contains a second derivative which can be written as a first derivative:

Define two functions as:

Now the differential equation contains two functions and is essentially a system of two differential equations:

The next step is to capture this information in a single vector valued function D for use with Mathcad’s differential equation solvers:


The unit placeholder can only have real...

The unit placeholder can only have real, non-zero scalars put into it.

You entered an illegal expression in the placeholder at the end of a calculation equation. This placeholder requires real, non-zero, scalar values.


The units in this expression do not match.

This error message has two likely causes:

  • You are adding or subtracting two terms with different units.

  • You have created a matrix in which the elements do not have the same units.

  • You are trying to solve a system of equations for unknown variables of different units. Here is an example of how to properly do so:


The Values in the Matrix

The values in the matrix are the values of z. The row and column indices are the corresponding values of x and y. The matrix you define must have at least two rows or two columns.


This variable or function is not defined above.

This variable or function is not defined above. (name marked in red)

This variable or function is undefined. To define it, enter the variable or function name, followed by a colon (:) and an expression or number for its definition. Make sure you define the variable or function name above the statements in which you plan to use it.

You also see this message if you use a variable incorrectly in a global definition. If you use a variable on the right side of a global definition, the variable must be globally defined above the definition in which it is used. If you use a locally defined variable or a variable whose global definition is below the place where it is used, the variable will be undefined.

NOTE: An undefined error is often an indication that another equation further up in the worksheet is in error. If this is the case, all expressions that use the expression in error will be displayed in red.


There is an extra comma in this expression.

Commas can be used to separate:

  • the arguments of a function,

  • the first two elements of a range in the definition of a range variable,

  • expressions in a plot,

  • elements in a Data Table,

  • subscripts in a matrix.

Any other use of commas will result in this error message. For example, you cannot use commas in a number such as 4,000. You should simply type 4000.


There must be more than three data points.

This function requires a vector having least 4 elements.


This array must have more than one row or column.

You performed an operation that requires a matrix. For example, when creating surface plots or contour plots, the array plotted must be a matrix, an array having at least two rows or two columns. Certain built-in functions also require matrix arguments.


This expression has a ( without a )

This expression has a “(“ without a matching “)”.

This expression does not contain equal numbers of ('s and )'s.


This expression is incomplete. You must fill in the placeholders.

You have not filled in the indicated placeholders. You should place numbers or expressions in these placeholders.


This expression is too complicated.

This expression is too complicated. Try defining it in smaller pieces.

This expression is too complicated to evaluate. Break the equation down into two or more smaller expressions.


This function is undefined at one or more of the points you specified.

You attempted to evaluate an operator or a function at an inappropriate value. For example, ln(0) will give this error. So will -3! because factorial is undefined for negative numbers.


This function needs more arguments.

This expression contains a function with fewer than the required number of arguments.

For built-in functions, click on the function name and press F1 to see the correct number and types of arguments. For functions you defined, check the definition.


This is invalid. If you are using a Mathcad program...

This is invalid. If you are using conditional statements in a Mathcad program, make sure all cases are accounted for.

For example, the program below is valid only when x is 4 or 5. When x is any other value, the program does not specify what to do.

To correct this, you can add an otherwise statement:


This is not allowed inside a solve block...

This is not allowed inside a solve block. For example, definitions are not allowed in a solve block.

You may have a definition statement below a "Given." Or you may have used two "Given"s in a row with no intervening "Find" or "Minerr". A solve block cannot have another solve block inside of it. As an alternative, you can define a function in terms of one solve block and use it inside another solve block. In many cases, this will have the same effect.


This list contains too many items.

You entered too many elements in a list separated by commas. This commonly occurs when you try to plot too many expressions on a plot axis.


This matrix must be square...

This matrix must be square. It should have the same number of rows as columns.

Some built-in functions require square matrices (a matrix having an equal number of rows and columns). Click on the function name and press F1 for additional information.


This must be an integer.

This must be an integer. The expression you used appears to have a fractional part.

This expression contains a non-integer expression where an integer is required. The expression may have a fractional part.

Some possible places to look are:

  • Superscripts and subscripts

  • Arguments to certain functions such as the identity function or the submatrix function.

Note that although you can define range variables with fractional values, you cannot use these as subscripts or superscripts.


This must be the name of a function or variable.

You used a number or other combination of symbols where you should have used the name of a function or a variable.


This must be the name of a mapping function.

This argument to CreateMesh or CreateSpace must be the name of a mapping function which determines the coordinate system. For example, the following functions are appropriate mapping functions for CreateSpace:

The argument to CreateSpace is name fmap.


This operation can only be performed on a function.

This argument must be a function. If you’re using a built-in function, click on the function name and press F1 for additional information.


This operation can only be performed on a number or an array.

The function or operator you are using requires a single constant, a matrix, or a vector.


This operation can only be performed on a string.

The function or operator you are using requires a string argument. For example, string functions usually require at least one string argument.


This operation can only be performed on an array.

This operation can only be performed on an array. It can’t be performed on a number.

You performed an operation that requires an array on a scalar. For example, you see this error if you define a superscripted variable as a scalar. Since a superscripted variable represents a column of a matrix, you must define it as a vector.

For surface plots or contour plots, the array plotted must have at least two rows or two columns.


This subscript is too large.

You tried to use a subscript or superscript that exceeds the limit, 8 million.


This system of equations has more unknowns...

This system of equations has more unknowns than there are equations.

This error marks a solve block with fewer constraints than variables to be solved. Add dummy constraints (such as 1=1) or decrease the number of variables to be solved for.


This value must be a matrix.

You are trying to perform a matrix operation on something other than a matrix. A matrix is an array consisting of more than one column.


This value must be a vector.

This error marks a matrix or scalar in an operation that requires a vector (a one-column array), for example, with the vector sum operator.


This value must be less than or equal to 10000.

This value must be less than or equal to 10000. If you’re using a built-in function, click on the function name and press F1 for additional information.


This value must be real.

This value must be real. Its imaginary part must be zero.

This expression contains an imaginary or complex valued expression somewhere in which it is not allowed.

Examples are subscripts and superscripts, differential equation solvers, mod, and angle.


This variable must be a range variable.

This expression requires a range variable.

If the expression contains either a summation or an iterated product, check to see that the index is in fact a range variable. The index is directly under the sigma or pi. It should have been defined in an earlier statement.


This vector has the wrong number of arguments.

This vector has the wrong number of elements.

This error marks a Fourier transform function whose argument has the wrong number of elements.

  • fft requires a vector with 2^n elements.

  • ifft requires an argument vector with 2^n+1 elements, where n is a whole number greater than 0.

Use cfft and icfft for arrays and vectors of any size.


This vector must have fewer than five columns.

The first argument of the loess function should be a real matrix having no more than 4 columns, each of which represent the data corresponding to a particular factor.


This vector should have more elements.

This error message marks a Fourier transform, cubic spline, or linear interpolation function applied to a vector with too few elements.

Splines and linear interpolation require vectors with at least two elements. Fourier transform functions and their inverses require at least four elements.


Tiling Worksheet Windows

Choose either Tile Horizontally or Tile Vertically from the Window menu.


To Evaluate an Expression

Click anywhere in the expression and press =.

You can also evaluate expressions symbolically by pressing [Ctrl]. for the symbolic evaluation operator.


Can't find a solution. Encountered too many iterations.

The function has passed through as many iterations as possible trying to find a solution. If you see this message when using the polyroots function, the degree of the polynomial may be quite high. Try solving for the roots symbolically instead.


Customize Toolbar Dialog Box

The Customize Toolbar dialog box has the following options:

Available buttons

Displays the buttons that you can add to the toolbar.

Toolbar buttons

Displays the buttons in the order they appear (from left to right) on the toolbar in the active window.

Add

Moves the button selected in the Available Buttons list to the Toolbar Buttons list. Another way to move the button is to drag it from the Available Buttons list to the Toolbar Buttons list.

Remove

Moves the button selected in the Toolbar Buttons list to the Available Buttons list. Another way to move the button is to drag it from the Available Buttons list to the Toolbar Buttons list.

Move up

Moves the selected button one up line. On the toolbar, the button shifts left one space. Another way to move the button is to drag it up.

Move down

Moves the selected button down one line. On the toolbar, the button shifts right one space. Another way to move the button is to drag it up.

Reset

Restores the set of buttons as they were when the dialog box was opened.


Toolbar Bold Text Button

Click on this button to change all text in that type of region to bold.

Or if you've selected some text, click on this button to change the selected text to bold.


Toolbar Centered-Aligned Text Button

Click on this button to center all the lines in a text region.


Toolbar Font Family List

This scrolling list shows the font family name for the text or math region your cursor is currently on.

To specify a new font, scroll through the list of available font family names. Highlight your selection and release the mouse button.


Formatting Toolbar

The Formatting toolbar contains scrolling lists and buttons used to specify font characteristics in equations and text. To learn what a button on the toolbar does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.

Or, click on a button name listed below to learn more about how to use it.

Style

Font family

Type size

Bold text

Italicize text

Underline text

Left-aligned text

Right-aligned text

Center-aligned text

Bullets

Numbers

Subscripts and Superscripts

To customize the Formatting toolbar, click on it with the right mouse button and choose Customize from the pop-up menu.


Toolbar Italicize Text Button

Click on this button to change all text in that type of region to italics.

Or if you've selected some text, click on this button to italicize the selected text.


Toolbar Left-Aligned Text Button

Click on this button to align all the lines in a text region against the left side of the region.


Toolbar Right-Aligned Text Button

Click on this button to align all the lines in a text region against the right side of the region.


Standard Toolbar

The buttons on the Standard toolbar give you quick access to many menu commands. To learn what a button on the toolbar does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.

To customize the Standard toolbar, click on it with the right mouse button and choose Customize from the dialog. The current group of additional buttons is pictured below.


Toolbar Style Button

If your cursor is in a math region, between numbers or variables, this window specifies the math style your cursor is currently on. The math style listed will be a math variable, a math constant, or one of any additional math styles you have defined.

If your cursor is in a text region, this window specifies the text style associated with the text region. The Type Size windows will show the specifications for that type of text region.


Toolbar Superscript and Subscript Buttons

Toolbar Subscript and Superscript Buttons

Click on these buttons to add subscripts or superscripts to text regions or math regions. Note that the math subscript is a literal subscript, not an array subscript operator.

Or if you've selected some text, click on these buttons to change the selected text to superscripted or subscripted.

Note: In a math region, pressing the superscript or subscript button a second time repeats the action. In a text region, pressing one of the buttons a second time returns the following characters to normally positioned text.


Toolbar Type Size Button

This scrolling list shows the type size of the text or math region your cursor is currently on.

To select a new type size, scroll through the list of available type sizes. Highlight your selection and release the mouse button.


Toolbar Underline Text Button

Click on this button to change all text in that type of region to underlined text.

Or if you've selected some text, click on this button to underline the selected text.


Control Toolbar

The Control toolbar and a corresponding Insert/Control submenu simplifies the inclusion of Windows-style controls in your worksheets.

Mathcad supports six different Windows-style controls: Check box, Radio button, Push button, Text box, List Box and Slider.

See the Developer's Reference for more details about using Controls in your worksheets. There are also sample controls files in the QuickSheets under the Help menu.


Resources Toolbar

The Resources toolbar streamlines access to Mathcad Tutorials, QuickSheets, and Reference Tables for quick referencing of information from novice to expert topics. Any E-Books or Extension Packs you install will appear here as well.


Tools - Disable/Enable Evaluation

Controls whether or not an equation is evaluated or not in your worksheet. Turning off a definition will cause an error in any region depending upon it.

This menu option changes depending on whether an equation is already disabled or not. By default, all equations are enabled unless explicitly disabled.


Tools - Optimize - Show Optimization

Displays a small window that contains the optimized form of the selected equation. Mathcad uses this optimized form when computing any result involving the equation.

Show Optimization is enabled only if an optimized form of the equation exists.


Tools - Trace Error

Brings up the Trace Error dialog box, which allows you to locate errors originating in regions upon which your evaluation is dependent.


Tools Menu Commands

Spelling...

Animation/Record...

Animation/Playback...

Protect Worksheet...

Calculate/Calculate Now

Calculate/Calculate Worksheet

Calculate/Automatic Calculation

Optimize/Optimize Equation

Worksheet Options...

Preferences...


Top margin

This is the distance from the top edge of the physical sheet of paper to the top edge of the print area. If your worksheet has a header, it appears just above this margin.


Trace of a Matrix

tr(M) Returns the sum of the elements along the diagonal of M.

Arguments:

  • M must be a square matrix.


Trace Settings (Polar Plots)

Trace Settings on Polar Plots

To select the characteristics of each trace:

  1. Double-click on a plot or choose Graph / Polar Plot from the Format menu to open a tabbed dialog box.

  2. Click on the Traces tab.

  3. Click on the trace's name under the Legend Label column of the scrolling list in the middle of the dialog box. The characteristics assigned to that trace appear in the six text boxes under the corresponding columns. These are:

    Legend label

    Symbol

    Line

    Color

    Type

    Weight

  4. To change any of these characteristics, click on the arrow beside the appropriate text box to see a drop-down list of options.

  5. To change the characteristics for another trace, click on its name in the scrolling list in the middle of the dialog box. Then assign its characteristics as described above.

  6. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Trace Settings (X-Y Plots)

To select the characteristics of each trace:

  1. Double-click on a plot or choose Graph / XY Plot from the Format menu to open a tabbed dialog box.

  2. Click on the Traces tab.

  3. Click on the trace's name under the Legend Label column of the scrolling list in the middle of the dialog box. The characteristics assigned to that trace appear in the six text boxes under the corresponding columns. These are:

    Legend label

    Symbol

    Line

    Color

    Type

    Weight

  4. To change any of these characteristics, click on the arrow beside the appropriate text box to see a drop-down list of options.

  5. To change the characteristics for another trace, click on its name in the scrolling list in the middle of the dialog box. Then assign its characteristics as described above.

  6. When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Traces Page for Polar Plots

The Formatting Currently Selected Polar Plot dialog box has the following options on the Traces tab:

Legend Label

Specifies the name of the trace as it appears on the legend.

Symbol

Controls whether each point on the curve is marked with a symbol. If you have a lot of points packed closely together, you should probably select "none."

Line

Controls whether the line is solid, dotted, dashed, or whether it consists of alternating dashes and dots. This provides a useful way to distinguish unmarked curves in black and white printouts.

Color

Controls whether the selected trace is red, blue, green, magenta, cyan (a light blue), brown, black, or white. This is ignored for a monochrome display.

Type

Controls whether the selected trace is shown as a bar chart, as a curve, as a stepped curve, a stem plot, or error bars.

Weight

Controls how thick the curve is. Use 1 for fine curves and 9 for thick curves. Use "p" to make the finest possible curve, a single pixel wide. Keep in mind that a "p" curve may not print on printers with inadequate resolution. This field also controls the size of the symbols marking data points, if you have selected a symbol other than “none.” If you have selected trace type points, this field sets the weight of the dot plotted at each data point.

Hide Arguments

Check this box to hide the math expressions you typed in the middle placeholder of each axis.

Hide Legend

Check this box to hide the legend that appears under the plot.


Traces Page for XY Plots

The following options are available on the Traces tab of the X-Y Plot Formatting dialog box:

Legend Label

This is the name of the trace as it appears on the legend.

Symbol

Controls whether each point on the curve is marked with a symbol.

If you have a lot of points packed closely together, you should probably select "none."

Line

Controls whether the line is solid, dotted, dashed, or whether it consists of alternating dashes and dots. This provides a useful way to distinguish unmarked curves in black and white printouts.

Color

Controls whether the selected trace is red, blue, green, magenta, cyan (a light blue), brown, black, or white. This is ignored for a monochrome display.

Type

Controls whether the selected trace is shown as a curve, a symbol/point, a bar chart, error bars, as a stepped curve, a stem plot, or as a solid bar plot.

Weight

Controls how thick the curve is. Use 1 for fine curves and 9 for thick curves. Use "p" to make the finest possible curve, a single pixel wide. Keep in mind that a "p" curve may not print on printers with inadequate resolution. This field also controls the size of the symbols marking data points, if you have selected a symbol other than “none.” If you have selected trace type points, this field sets the weight of the dot plotted at each data point.

Hide Arguments

Check this box to hide the math expressions you typed in the middle placeholder of each axis.

Hide Legend

Check this box to hide the legend that appears under the plot.


Tracing Errors

When a worksheet contains an expression that is dependent on one or more definitions made earlier in the worksheet, an error in that expression may originate in an earlier definition. Consider the example below:

Here, the error appears in the fifth region, p(0). However, p(x) is based on the definition of f(x). When x is zero, p(x) is undefined, and thus an error appears.

Although the source of the error may be clear in this case, in more complicated worksheets, or in programs with repeated calculations, it may not be. Error-tracing detects the original source of an error. To trace an error:

  1. Click on the region showing the error with the right mouse button and choose Trace Error from the pop-up menu. Alternatively, click in the region and choose Trace Error from the Tools menu. The Trace Error dialog box appears.

  2. Use the buttons in the dialog box to navigate among the regions associated with the region showing the error. The buttons are as follows:

  • Previous - Steps back to the previous region involved in the error.

  • Next - Steps forward to the next region involved in the error.

  • First - Jumps back to the first region involved in the error.

  • Last - Jumps forward to the last region involved in the error (i.e. the region displaying the error message).

  • Close - Closes the dialog box.

Notes:

  • If the error is in a region in a collapsed area, the error tracing mode ends and a message appears indicating that the error is in a collapsed region and error tracing will not continue.

  • Trace Error will not be able to trace out of a Solve Block.


Track Data Points

Normally, the crosshair snaps from one data point to the next along a trace. To make the crosshair follow your pointer anywhere on the plot, uncheck the "Track Data Points" check box.


Transpose Operator

Keystroke: Ctrl+1

This returns the n x m array formed by interchanging rows and columns of an m x n array.

Operands:

  • M is an m x n array.

Although you can use the matrix transpose operator to find matrix transposes numerically, you can also find matrix transposes symbolically.


Treefix Notation

Treefix notation is another way of displaying binary operators. In treefix notation, the operator and its associated operands are arranged in a tree-like structure as shown below.


Trigonometric Complex Identities

Complex arguments and results are computed using the identities:


Trigonometric functions

sin(z) cos(z)

tan(z) csc(z)

sec(z) cot(z)

sinc(z) = sin(x)/x

sinc is a special function which correctly evaluates sin(x)/x = 1 in the limit as x approaches 0.

Arguments:

z must be in radians.

z must be a scalar (real, complex, or imaginary).


Numerical Issues in Trigonometric Functions

Because the trig functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

Trigonometric functions are especially subject to roundoff error in the following cases:

Large arguments

For real arguments approaching 109 in magnitude, these functions begin to lose precision. When this happens, you'll see an error message indicating a loss of precision.

Singularities

The tangent function is undefined at integer multiples of p/2. Arguments near this singularity are subject to precision errors.

Multiples of p

Since the value of p on a computer can only be an approximation of p, sin(p) is very close to, but not exactly 0. Similarly, tan(p/2) is not undefined, but returns a very large number.

If you need more exact values, use symbolic evaluation with a decimal point to force floating point calculations.

Sin(x)/x in the limit as x approaches 0

Sin(x)/x as x approaches 0 has a value of 1. Mathcad will return this value when x is used as the argument to sin and as the denominator in the fraction, or if the same function f(x)=0 is used as both argument and denominator. In the case where g(x)=sin(x) and f(x)=x, g(x)/f(x) will return 0, following the normal Mathcad rules for the fraction 0/0. If you wish to guarantee you get the correct behavior, use sinc(x).


Truncation and Rounding Functions

floor(z) Returns the greatest integer ≤ z

Floor(z, y) Returns the greatest multiple of y ≤ z

ceil(z) Returns the smallest integer ≥ z

Ceil(z, y) Returns the smallest multiple of y ≥ z

round(z) Returns floor(z) if the decimal part is less than .5, and ceil(z) otherwise.

Round(z, y) Rounds z to the closest multiple of y.

trunc(z) Returns the integer part of z by removing the fractional part.

Trunc(z, y) Returns trunc(z/y)*y

Arguments:

  • z is a complex number.

  • z must be dimensionless for floor, ceil, trunc, and round.

  • y must be real and nonzero.

  • For Floor, Ceil, Trunc, and Round, z and y must both be either dimensioned or dimensionless.

Note:

floor and trunc return the same results for positive values of x. For negative values of x, however, the results are different: floor(–2.6)=–3 but trunc(–2.6)=–2.

Further, floor and ceil yeild different results under symbolic evaluation for complex arguments, because Maple uses a different definition that treats the real and complex parts of the argument simultaneously.

Launch QuickSheet Example


Two Dimensional Vector Field

In a vector field, each point (x, y) has a vector associated with it. A vector field plot shows this vector as a small arrow emerging from each point. The arrow's length and direction correspond to the magnitude and direction of this associated vector.


Two Kinds of Minus Signs

There are really two kinds of minus sign. This one refers to the one in an expression like:

"-1" or "-(x + z)"

The other kind of minus sign is the one you see between numbers like:

"(x - z)"

You delete this kind of minus sign the same way you delete a plus sign.


Two Page - One Page

Toggles between “Two Page” and “One Page” buttons. Click “Two Page” to show two pages of your worksheet at a time. Click “One Page” to show only one.


Two Point Boundary Value Problems

To solve an nth order initial value problem, you need to know the value of the function and its first n-1 derivatives at the beginning of the integration interval. If you don't know this but:

  • You know some of the values of the solution and its derivatives at the beginning of the integration interval, and

  • You know some of the values of the solution and its derivatives elsewhere in the integration interval, and

  • Together you have n known values

Then you can solve for the unknown values at the beginning of the integration interval and convert your boundary value problem to an initial value problem amenable to solution by rkfixed and the other differential equation solvers.

  • If you know the values at the endpoint of the integration interval, use sbval.

  • If you know the values somewhere in the middle of the integration interval, use bvalfit.

Examples

Using the sbval function

Using the bvalfit function


Type “TOL=” to see what the Tolerance is set to

TOL should be greater than 0 and less than or equal to 1. Redefine it if necessary.

The built-in constant TOL is outside the allowable range.

To fix the error, define TOL with a value

  • greater than (but not equal to) 0, and...

  • less than or equal to 1

above the indicated expression.


Typing Symbols in a Name

Usually when you type a symbol such as $ that is used to create an worksheet operator, you get the operator instead of the actual symbol $.

To type the actual symbol instead of the operator inside a variable or function name:

  1. Type a letter or number to begin the name.

  2. Type Ctrl+Shift+K to enter a special "text" mode.

  3. Type one or more symbols such as $. The editing lines turn red to indicate you are in the special text mode.

  4. Type Ctrl+Shift+K again to return to regular math mode.

Example:

You can create variable definitions such as:

x@3:00 := 20

and

a+b := 3.24 - 5


Unary Operator

An operator with a single operand. For example, the factorial operator, "!" is a unary operator because you would always see "n!". Here, n is an operand.

Other examples of unary operators are the square root and the complex conjugate.


Underflow

Because of limitations inherent in representing numbers in a computer, numbers that are too small cannot be represented. When an expression involves such a number, you'll see this error message.

Sometimes, especially in a complicated calculation, an intermediate result will be too small to represent.


Uniform Distribution

Distributions relating to the Uniform Equation

dunif(x,a,b) Returns the probability density.

punif(x,a,b) Returns the cumulative probability distribution.

qunif(p,a,b) Returns the inverse cumulative probability distribution.

rnd(x) Returns a uniformly distributed random number between 0 and x.

runif(m,a,b) Returns a vector of m random numbers having the uniform distribution.


Uniform Polyhedra (Defined)

Uniform Polyhedra

The uniform polyhedra are regular polyhedron whose vertices are congruent. Each has a name, a number, a dual (the name of another polyhedron), and a Wythoff symbol associated with it.

Here are a few uniform polyhedra:

Name | Number code | Wythoff symbol | Dual name
pentagonal prism | 1 | 2 5|2 | pentagonal dipyramid
icosahedron | 27 | 5|2 3 | dodecahedron
cube | 11 | 3|2 4 | octahedron

To graph a uniform polyhedron, use the Polyhedron function. To look up the name, Wythoff symbol, and dual name, use the PolyLookup function.

Refer to other sources for a full discussion of uniform polyhedra.


Unit Placeholder

If you click on a numerical result, you'll see a small black box to the right of the result. This is the 'unit placeholder'.

To fill the placeholder, click on it and type the name of a unit.


UnitsOf Function

UnitsOf(z) Returns the units of z. Returns 1 if z has no units.

Arguments:

z is any value or array.

Example:

Notes:

You can divide a value by the UnitsOf function to make it unitless. For example, some built-in functions, such as ln, require their arguments to be unitless. If an argument to ln has units, you can divide the argument by UnitsOf to make the argument unitless:


Unlocking a Collapsed Area

To unlock a collapsed area:

  1. Click between area boundaries you want to unlock.

  2. Choose Area / Unlock from the Format menu. If a password is required, you'll be prompted for the password.

Note: You must unlock a collapsed area before expanding it.


Unlocking a Locked Area

To unlock a locked area:

  1. Click between the are boundaries of the area you want to unlock.

  2. Choose Area / Unlock from the Format menu. You may see a dialog box prompting you for a password.


Unsuccessful Symbolic Transformation

Symbolic transformations may fail to occur for a variety of reasons. For example you may have tried to factor an unfactorable expression. Or you may be trying to simplify an expression that cannot reasonably be simplified.


Until and Range Variable Limitations

Do not use the until function in equations with more than one range variable (for example, multiple summations). Iteration will halt on all range variables the first time that the first argument of until is negative. This usually does not produce the desired result.


The until function

Function for iteration

until(x, y) This function allows you to halt an iterative process based on a condition. Returns y until x is negative.

Arguments:

x is a test expression (usually involving a negative, the until function halts iteration.

y is the value returned by the until function at each iteration.


Untitled Worksheet

This is where you can start typing to create a new worksheet. The appearance of an untitled worksheet is based on the NORMAL.MCT template file.

To open previously saved worksheets, choose Open from the File menu.


Up Arrow Movement

In blank space

Moves the crosshair up. If another region lies immediately above, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.

In math

Moves the editing lines up. If they are already at the top of the expression, it jumps out of the math expression altogether and becomes a crosshair in the blank space just above it.

In text

Moves the text insertion point to previous line. If it is already in the first line, it jumps out of text altogether and becomes a crosshair just above it.

Nudging regions

Moves the selected region(s) one space up or if held down, moves upwards more quickly.


Updating Results in Manual Mode

To update only what you see in the window:

  • Choose Calculate from the Tools menu.

Your worksheet performs whatever computations are necessary to update all results visible in the worksheet window. When you move down to see more of the worksheet, you must recalculate to see up-to-date results.

To update all results throughout the worksheet:

  • Choose Calculate Worksheet from the Tools menu.


Upward Compatibility

Worksheets are upwardly compatible. This means that they will open in newer versions of the application, but will not open in older versions.


URL

URL (Universal Resource Locator)

This is the path name to a particular file on the Internet. For example, the URL to the Mathsoft home page on the World Wide Web is "http://www.mathsoft.com"


User Math Styles

Rather than change the font of a name or number directly, you can create a new math style and assign the it to one or more names or numbers.

To create a new user math style:

  1. Choose Equation from the Format menu.

  2. Choose an unused math style such as “User1.”

  3. In the “New Style Name” box, type a name for this new math style.

  4. Click on the “Properties” button and choose a font, size, and style for this math style.

  5. Click “OK.”

To apply this math style to a particular name or number:

  1. Click on the name or number.

  2. Choose Equation from the Format menu.

  3. In the dialog box, choose a math style from the drop-down list.

  4. Click “OK” to assign the selected style to the selected name.


Using a Custom Binary Operator

To insert a binary operator you've defined previously, click wherever you want to insert the operator and do the following:

  1. Open the Evaluation toolbar containing the custom operator notation buttons.

  2. Click [image] for "infix"notation or [image] for "treefix" notation. You'll see:

  3. Type the name of the operator in the middle placeholder. Examples:

  4. In the remaining two placeholders, type the operands. Examples:

Launch QuickSheet Example


Using a Custom Unary Operator

To insert a unary operator you've defined previously, click wherever you want to insert the operator and do the following:

  1. Open the Evaluation toolbar containing the custom operator notation buttons.

  2. Click [image] for postfix notation or [image] for prefix notation. You'll see

  3. For prefix notation, type the name of the operator in the left placeholder. For postfix notation, type it in the right placeholder. For example:

  4. In the remaining placeholder, type the operand. For example:

Launch QuickSheet Example


Using a Mouse to Resize a Text Region

To change the width of a text region using the mouse:

  1. Select the text region.

  2. Move the cursor to a handle on the side of the region. It should change to a double-headed arrow.

  3. Drag the mouse to the right or left. The text region will change size as you drag the mouse.

  4. Once the text region is the right size, let go of the mouse button.


Using End Values to Derive Initial Conditions

sbval(v, x1, x2, D, load, score) Returns a vector containing those initial values left unspecified at x1.

Arguments:

v is a vector of guesses for the initial values left unspecified at x1.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated.

D is an n-element vector-valued function containing first derivatives of the unknown functions.

load is a vector-valued function whose n elements correspond to values of the n unknown functions at x1. Some values will be constants specified by your initial conditions. Others will be unknown at the outset but will be found by sbval. If a value is unknown, use the corresponding guess value from v.

score is a vector-valued function having the same number of elements as v. Each element is the difference between an initial condition at x2, as originally specified, and the corresponding estimate from solution. The score vector measures how closely a proposed solution matches the initial conditions at x2. A value of 0 for any element indicates a perfect match.

Notes:

  • sbval solves a two-point boundary value problem by shooting from the endpoints and matching the trajectories of the solution and its derivatives at the intermediate point.

  • sbval computes the initial values the solution must have in order for the solution to match the final values you specify. You must then take the initial values returned by sbval and solve the resulting initial value problem.

  • When you know the solution at x1 and at x2, and you have n known values, you should use sbval to evaluate the missing initial values at x1. Once you have these missing initial values, you will have an initial value problem rather than a two-point boundary value problem.


Using Floating Point Evaluation

Use the Floating Point command on the Symbolics menu to numerically evaluate constants like pi. Specify the number of digits to the right of the decimal point in the dialog box that appears after choosing this command. By default, this number is set to 20.


Using Intermediate Values to Derive Initial Conditions

bvalfit(v1, v2, x1, x2, xf, D, load1, load2, score)

Returns a vector containing those initial values left unspecified at x1.

Arguments:

v1 is a vector of guesses for the initial values left unspecified at x1. v2 is a vector which contains guesses for initial values left unspecified at x2.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated.

xf is a point between x1 and x2 at which the trajectories of the solutions beginning at x1 and those beginning at x2 are constrained to be equal.

D is an n-element vector-valued function containing the first derivatives of the unknown functions.

load1 is a vector-valued function whose n elements correspond to the values of the n unknown functions at x1. Some of these values will be constants specified by your initial conditions. If a value is unknown you should use the corresponding guess value from v1.

load2 is analogous to load1 but for values taken by the n unknown functions at x2.

score is an n-element vector valued function used to specify how you want the solutions to match at xf. You'll usually want to define score(xf, y) := y to make the solutions to all unknown functions match up at xf.

Notes:

  • bvalfit solves a two-point boundary value problem by shooting from the endpoints and matching the trajectories of the solution and its derivatives at the intermediate point. This method becomes especially useful when the derivative has a discontinuity somewhere in the integration interval.

Example:

Using the bvalfit function


Using Quicksheets to Insert an Operator Name

Although a custom operator can have any name at all, operator names commonly involve math symbols not readily available from the keyboard. The simplest way to get these symbols is to drag them from a QuickSheet window as follows:

  1. Open QuickSheets from the Help menu.

  2. Click on "Math Symbols". You'll see a collection of math symbols not readily available from the keyboard.

  3. When you see the math symbol you want, drag it to your worksheet.

You can also paste in a symbol from another application or if you know the ANSI code, you can hold down the Alt key while typing the ANSI code using the numeric keypad.

You can find codes for special symbols in the back of the Mathcad User's Guide or by choosing Character Map from System Tools in Accessories under the Program files in your Start menu.


Using Several Keywords

To symbolically evaluate the result of a previous keyword, you can string several keywords together. There are two ways of doing this. One method shows the intermediate results from each keyword. The second method shows the final result after applying all the keywords.

To show intermediate results:

  1. Type the expression you want to evaluate symbolically and press Ctrl +Shift +Period. Type a keyword in the placeholder.

  2. Press Enter to see the result from that keyword.

  3. Press Ctrl +Shift +Period followed by another keyword.

  4. Press Ctrl +Period followed by Enter to see the final result.

To apply several keywords but see only the final result:

  1. Type the expression you want to evaluate symbolically and press Ctrl +Shift +Period. Type a keyword in the placeholder.

  2. Press Ctrl +Shift +Period to insert a vertical line and a placeholder.

    Enter another keyword into the placeholder.

  3. Press Ctrl +Shift +Period again to enter another keyword or press Enter to see the final result.


Using the bvalfit function


Using the Crosshair

The next math or text region you type begins at the location of the crosshair.

Note that as soon as you begin typing, the cursor turns into either a pair of editing lines or a text insertion point.


Using the Editing Lines

Use the editing lines to select parts of your math expression. Putting part of an expression between the editing lines is just like enclosing it in a pair of invisible parentheses. There are two parts to the editing lines:

  • The underline, or the horizontal editing line

  • The insertion line, or the vertical editing line

To place an expression between the editing lines as described above:

  1. Click in the expression with the mouse.

  2. Use the arrow keys if necessary to move the editing lines.

  3. If necessary, press the Space key to lengthen the editing lines until they hold the expression between them. Or click in different parts of the expression to change what's between the editing lines.

As a general rule:

Whatever is underlined and to the left of the insertion line becomes the first operator you type.


Using the Keyboard to Resize a Text Region

To change the width of a text region using the keyboard:

  1. Click in the text region and move the insertion point to wherever you want the text region to wrap.

  2. Press Ctrl+Enter.

Note that this method can only be used to make a text region narrower. To make a text region wider, you must use the mouse.


Using the sbval function


Using the Spacebar

Use the Space key to select different parts of a math expression. What you select will depend on where the editing lines are to begin with. For example:


Using the Symbolic Equal Sign or the Menu Commands

To perform symbolic calculations, use either the symbolic equal sign (shown as a right-facing arrow) or the menu commands on the Symbolics menu.

Using the symbolic equal sign

Just like numerical processing in Mathcad, using the symbolic equal sign is “live.” That is, Mathcad checks all the variables and functions making up the expression being evaluated to see if they have been defined earlier in the worksheet. If Mathcad does find a definition, it uses it. Any other variables and functions are evaluated symbolically. Later on, whenever you make a change to the worksheet, the results automatically update. This is useful when the symbolic and numerical equations in the worksheet are tied together.

Using the Symbolics menu commands

Unlike numerical processing and the symbolic equal sign, the commands from the Symbolics menu are not live. You apply them on a case by case basis to selected expressions, they do not "know" about previous definitions, and they do not automatically update. Use the menu commands when a symbolic calculation is quite separate from the rest of your worksheet and does not need to be tied to any previous definitions.


Using the Text Insertion Point

Use the text insertion point to insert and delete characters the same way you would in a typical word processor.

The next character you type will appear at the insertion point. Pressing BkSp or Del deletes the character to the left or right of the insertion point.


Using WRITERGB to Write Data to a File

This is the name of the bitmap file into which WRITERGB will place the data. If such a file already exists, WRITERGB will overwrite it.

WRITERGB assumes that this file is in the default directory. If you want to write to a file located elsewhere, you must type the full pathname to the file of interest.


Value of subscript or superscript is too big (or too small) for this array.

This expression uses a subscript or superscript that refers to a nonexistent array element.

The subscript or superscript should not be smaller than the ORIGIN. Type “ORIGIN=” to see what the ORIGIN is set to.


Variable and Function Name Restrictions

  • A name cannot start with one of the numbers 0 through 9, an underscore ( _ ), a prime symbol `, or a percent ( % ).

  • The infinity symbol can only appear as the first character in a name.

  • All characters in a name must be in the same font, have the same point size, and be in the same style.

  • Variable names and function names are not distinguishable. Thus, if you define f(x), and later you define the variable f, you will find that you cannot use f(x) anywhere below the definition for f.

  • Certain names are already used for built-in constants, units, and functions. Although you can redefine these names, keep in mind that their built-in meanings will no longer exist after the definition. For example, if you define a variable called mean, the built-in function mean(v) can no longer be used.

  • Differences between uppercase and lowercase letters are distinguishable. For example, diam is a different variable from DIAM.

  • Differences between names in different fonts are distinguishable. For example, AREA is a different variable than AREA (with Italics).


Variables Style

This is the default math style assigned to any variable or function name you type in the worksheet.


Vbscript

Microsoft VBScript is a strict subset of the Visual Basic for Applications language used in Microsoft Excel, Project, Access, and the Visual Basic 4.0 development system. VBScript is designed to be a small and lightweight interpreted language, so it does not use strict types (only Variants). Also, because VBScript is intended to be a safe subset of the language, it does not include file input/output or direct access to the underlying operating system.


Vector (defined)

A vector is an array or matrix containing one column of numbers.


All the elements in the vector cannot be the same.

The elements in this vector should not all be the same. If you’re using a built-in function, click on the function name and press F1 to make sure you are using the function correctly.


Vector Magnitude Operator

Keystroke: |

| v |

Returns the magnitude of the vector v. This is the square root of the sum of the squared magnitude of the elements in v.

Operands:

  • v is a vector

To take the magnitude of each element in a vector:

  1. Place the | v | between the editing lines.

  2. Apply the vectorize operator, Ctrl+-.


Vector Returned by Cspline

The first three values returned by cspline, lspline, and pspline are used by the interp function. The remaining elements are the second-derivative coefficients. If you would like to access only the second derivatives, use the submatrix function.


Vector Returned by Regress

Regress returns a vector in which the first three elements are values used by the interp function. The remaining elements are the coefficients of the best fitting polynomial of degree k.


Vectorize Operator

Keystroke: Ctrl+-

Changes the meaning of operators and functions so that they apply to every element of an array. This allows you to perform calculations in parallel.

Operands:

A and B are arrays with the same number of rows and columns.

To vectorize an expression,

  1. Place the expression between the editing lines.

  2. Press Ctrl+-.

Examples:

To perform matrix multiplication of A and B, you would see

To multiply each element of A by the corresponding element in B.

Note:

Many functions and operators automatically perform operations on the elements of arrays so you do not always have to use the vectorize operator. Use the vectorize operator primarily when a function or operator has a special meaning for arrays. For instance, in the examples above, multiplication has a special meaning for arrays and that meaning is used by default. The vectorize operator has to be used to force an element-by-element multiplication.

Launch QuickSheet Example


Vectorizing in Symbolics

Use the vectorize operator to apply a built-in function to each element of a matrix, as illustrated below. To apply the vectorize operator, select the whole expression (function and matrix argument) and press Ctrl+ -. Then choose Simplify from the Symbolics menu.


Tools - Animation - Record

Opens a dialog box for creating an animation. To use it:

  1. Create anything that depends on the FRAME variable. This would generally be an expression or plot involving FRAME.

  2. Choose this menu command.

  3. Drag the mouse to enclose that portion of the worksheet you want to animate.

  4. Set the starting and ending values of FRAME in the dialog box.

  5. Click the "Animate" button.

Once the animation is created, you'll see a new window to be used for playing it back.


Tools - Animation - Playback

Opens the following window for playing existing animation clips:


Tools - Preferences

Brings up the Preferences dialog box, containing General, HTML Options, Script Security, and Language tabs.

Use the General tab to customize elements of the Mathcad user interface, such as keyboard shortcuts and startup settings.

Use the HTML Options tab to specify how documents are exported to HTML/MathML.

Use the Script Security tab to specify document protection level.

Use the Language tab to customize language-specific features in Mathcad, such as the spell check dialect and menu appearance.


View - Refresh

Redraws the screen.


View - Regions

Displays all regions in the default background color leaving the rest of your worksheet gray. The small dot to the left of each region is the region's anchor point. The anchor point indicates the actual location that is used as the worksheet is being calculated.

To restore the normal worksheet view, choose this command again.


View - Ruler

Hides or displays the worksheet/text ruler:

When you click in a blank spot of a worksheet, you can use the worksheet ruler to set tabs for the worksheet or to insert alignment guidelines to help you align regions vertically.

When you click in a text region, the worksheet ruler changes to the text ruler. It is the same size as the text region. Use it to set tab stops and indentation in text.


View - Status Bar

The Status Bar is just below the horizontal scrollbar at the bottom of the main worksheet window. Check the parts of the Status Bar for various information:

  • When you are editing an equation, the message line of the Status Bar gives you tips on what to do next.

  • When the mouse hovers over a button on a toolbar, the message line of the Status Bar displays a description of the button.

  • Check the lower right part of the Status Bar to see what page you are on.

  • "Auto" means the worksheet is in automatic mode.

  • "Calc F9" means the worksheet is in manual mode and that you should press the F9 key to calculate and see results.


View - Toolbars

Hides or displays the following toolbars:

Standard

Formatting

Math

Control

Resources

Calculator

Graph

Matrix

Evaluation

Calculus

Boolean

Programming

Greek

Symbolic

Modifier

To find out what a button on a toolbar does, move the cursor to the main worksheet window and allow the cursor to hover over the button until:

  • A tooltip (small pop-up window) shows the button title.

  • A description of the button appears on the message line of the Status Bar.


View - Zoom

Zooms in for a close-up view by making this number larger than 100%.

To bring unseen portions of a worksheet into view or to display an entire worksheet, make this number smaller than 100%.


View Menu Commands

Toolbars

Ruler

S tatus Bar

Header and Footer...

Regions

Refresh

Zoom...


Viewing the Original Copy of your E-book

To temporarily view the currently open section from the unmarked copy of your E-book:

  • Choose View Original Section from the Book menu.

To return to viewing the edited copy of the currently open section:

  • Choose View Edited Section from the Book menu.


WAV Access Functions

READWAV(file) Creates a matrix containing signal amplitudes in file. Each column represents a separate channel of data. Each row corresponds to a moment in time.

WRITEWAV(file,s,b) Creates a WAV signal file out of a matrix. Used as follows:

WRITEWAV( file,s,b) := M

The function must appear alone on the left side of a definition. If the specified bit resolution b is 1-8, the data is written to file as unsigned byte data. The limits on unsigned byte data are 0 to 256. If the bit resolution b is 9-16, word data (two bytes) is written to file. The limits on word data are -32768 to 32767.

GETWAVINFO(file) Creates a vector with four elements containing information about file. The elements corresponds to the number of channels, the sample rate, the number of bits per sample (resolution), and average number of bytes per second, respectively.

Arguments:

  • file is a string variable corresponding to pulse code modulated (PCM) Microsoft WAV filename or path.

  • s is an integer sample rate.

  • b is the bit resolution.

  • M is an integer matrix.

Launch QuickSheet Example


Wavelet Transforms

wave(v) Returns the wavelet transform of the data in v using Daubechies four-coefficient wavelet filter.

iwave(u) Returns the inverse discrete wavelet transform corresponding to wave of the data in u.

Arguments:

  • v and u must have 2m elements, where m is an integer.

  • All elements of v must be real.

Launch QuickSheet Example


Web Browse Button


Weibull Distribution

Distributions relating to the Weibull Equation:

dweibull(x,s) Returns the probability density for the Weibull distribution.

pweibull(x,s) Returns the cumulative probability distribution.

qweibull(p,s) Returns the inverse cumulative probability distribution.

rweibull(m,s) Returns a vector of m random numbers having the Weibull distribution.


Welcome to Mathcad

Mathcad is the industry standard calculation software for technical professionals, educators, and college students. Mathcad is as versatile and powerful as programming languages, yet it's as easy to learn as a spreadsheet. Plus, it is fully wired to take advantage of the Internet and other applications you use every day.


What Is a Component?

A component is a specialized OLE object inserted into a Mathcad worksheet to create a link between the worksheet and either a data source or another application containing data. To insert a component, choose Component from the Insert menu. The following components are available:

  • Axum, for creating Axum graphs in a Mathcad worksheet.

  • File Input and File Output, for reading and writing data files in a variety of formats. (Choose Data from the Insert menu.)

  • Data Acquisition, for sending data to or getting data from a measurement device.

  • Excel, for creating a link between a worksheet and an Excel file.

  • Data Table for entering data into a spreadsheet-like table.

  • Mathsoft Control, for creating custom controls such as buttons, sliders, and textboxes that allow users to interface with your Mathcad worksheet. (Choose Control from the Insert menu.)

  • MATLAB, for creating a link between a Mathcad worksheet and a MATLAB file.

  • ODBC Read for retrieving information from a SQL supported ODBC database.

  • Scriptable Object, for creating a custom component via a scripting language.

  • S-PLUS Graph and S-PLUS Script, for creating S-PLUS graphs and running S-PLUS scripts in a Mathcad worksheet.


When You Want Only the Last Point

If you're not interested in seeing all the intermediate values taken by the solution, you can save processing time and reduce memory consumption by using one of the functions below.

radau, stiffb and stiffr for stiff systems.

rkadapt for slowly varying systems.

bulstoer for smooth systems.

Unlike their uppercase equivalents, you don't specify the number of points in the result. Instead, you specify the level of accuracy and allow these functions to generate a solution having the required number of elements.


Where the Crosshair can Appear

The crosshair can exist only outside a math or text region.

This is the only cursor that can exist in a blank spot in your worksheet.


Where the Editing Lines can Appear

Editing lines can appear only in a math expression.


Where the Text Insertion Point can Appear

The text insertion point can exist only in a text region.


While Loops

Use a while loop whenever you want a set of statements to keep executing until a condition is met. Make sure you have a statement somewhere that makes the condition false. Otherwise the loop will execute indefinitely and you will need to stop it by pressing Esc.

To insert a while loop:

  1. Click in the placeholder into which you want to place the loop.

  2. Click [image] on the Math toolbar to open the Programming toolbar containing the programming operators.

  3. Click on the while button or press [Ctrl] + ]. Do not just type the word "while".

  4. In the placeholder to the right of the "while", type a boolean expression. Click the Add Line button on the Programming toolbar to insert placeholders for additional statements if necessary.

  5. In the placeholder below the "while", enter the statement you want to execute repeatedly. Use the Add Line button to insert placeholders for additional statements if necessary.

While loops are useful when you want to stop execution upon occurrence of a condition and you don't know exactly when that condition will occur. If you know exactly how many iterations you want, use a for loop instead.


Window - Arrange Icons

Neatly arranges the title bars of any minimized worksheets which appear in the lower left corner of the application window.


Window - Cascade

Hides inactive worksheet windows behind the active window without obscuring any title bars.


Window - List of Open Worksheets

Any open worksheets are listed under the Window menu. The one with the check next to it is the active worksheet. Click on one of the other worksheets listed to make it the active worksheet.


Window - More Windows

Brings up a dialog containing a list of all the open worksheets. This menu item is available only when you have more than 10 open worksheets. Click on any of the worksheets listed to make it the active worksheet.


Window - Tile Horizontal

Arranges all worksheet windows so that they:

  • Completely cover the application window

  • Are laid out one above the other


Window - Tile Vertical

Arranges all worksheet windows so that they:

  • Completely cover the application window

  • Are laid out side by side


Window Menu

Cascade

Tile Horizontal

Tile Vertical

List of Open Windows

More Windows


Working with a Picture

Using the Picture toolbar

There are many ways to work with a picture. You can modify the orientation, view (zoom and pan factors), brightness, contrast, and grayscale mapping of a picture in your worksheet using the Picture toolbar. To do so:

  1. Click on the picture so you see hash marks around the picture’s border, as shown.

  2. The Picture toolbar will pop up. To find out what operation each tool performs, hover over it briefly to see its tooltip.

For example, to zoom in on the picture, click [image] on the Picture toolbar and then repeatedly click the picture until you reach the desired resolution. You can also zoom out, zoom to window, or reset the zoom factor using [image], [image], or [image], respectively.

The tools available on the Picture toolbar can also be accessed by right-clicking on the image.

Using the Properties dialog box

You can change your color model or select an output option under the Properties dialog box. To do so:

  1. Right-click on the picture and select Properties from the pop-up menu.

  2. Under the Input and Output tab of the Properties dialog box, make your adjustments in the Input and Output panels, and then click “OK.”

For example, you can send the color map information for a selected rectangle of the picture to a variable in your worksheet. You might do this if you want to create another picture that only captures part of the whole image. In the Properties dialog box, check “Output Selected Matrix” in the output pane and select a color map option. Once you click “OK,” you need to type a variable name in the placeholder at the left of the picture region.

Notes:

  • There are two Properties dialog boxes for the Picture region. One controls the properties of the region including showing a border, highlighting the region, and disabling calculation of the region. The other controls the properties of the image displayed in the region, as discussed above.

  • If you have the Image Processing Extension Pack or the Communication System Design (CSD) Pack, then you already have an Image Viewer component that behaves in a manner similar to a picture region. Both the Image Viewer component and a picture region allow you to import image files and manipulate them with specialized toolbar options.

Launch QuickSheet Example


Working with Degrees

The trigonometric functions all assume that the argument is in radians. You can define your own trig functions to accept degrees as arguments. The example below illustrates this.

See Converting to degrees.


Working with Mathcad and Excel

If you use both Mathcad and Excel, you can easily integrate the two applications in ways ranging from copying and pasting data from one application to the other, to inserting objects from one application into the other, to integrating calculations from one application into the other.

What do you want to do?

  • Bring data from Excel into Mathcad

  • Send data from Mathcad to Excel

  • Insert Excel objects into Mathcad

  • Insert Mathcad objects into Excel

  • Integrate Excel calculations in my Mathcad worksheet

  • Integrate Mathcad calculations in my Excel worksheet


The Worksheet Ruler

The worksheet ruler is a helpful tool for aligning regions in your worksheet.

To display the worksheet ruler:

  1. Click in a blank spot in your worksheet or on a math region.

  2. Select Ruler from the View menu.

You should now see the worksheet ruler at the top of the window.

To set an alignment guideline on the ruler:

  1. Click on the ruler wherever you want the alignment guideline to appear. A tab stop symbol appears on the ruler.

  2. Click on the tab stop symbol with the right mouse button and choose Show Guideline from the pop-up menu. A check appears next to the command.

  3. You can also set guidelines and tabs using the Tabs choice on the Format menu.

The alignment guideline appears as a green vertical line. Select and move regions next to the guideline.

To remove an alignment guideline, click on the ruler with the right mouse button where the guideline is located and choose Show Guideline from the menu to uncheck it.

Notes:

  • The tab stops you insert on the ruler specify where the cursor should move when you press the [TAB] key. To remove a tab stop, click on its symbol, hold the mouse button down, and drag the cursor away from the ruler.

  • You can change the measurement used in the ruler by clicking on the ruler with the right mouse button, and choosing Inches, Centimeters, Points, or Picas from the pop-up menu.

  • Ruler visibility and measurement system are saved when you create a template. Thus, to change the ruler measurement for all your documents, change it in the template file NORMAL.MCT.


Writing Data to a Data File (WRITE function)

Writing Data to a Data File

WRITE(“file”) Writes a number to file.

Arguments:

file is either the pathname to an ASCII file.

file is entered as a string.

WRITE is usually used in conjunction with a vector and a range variable as in:

i := 1..N

WRITE(“file.dat”) :=

The above example writes the list of numbers in the vector v into file.dat.

WARNING: This function is provided only for compatibility with old worksheets that may be using it. It is, however, obsolete and its use is not recommended. Instead, you should use the WRITEPRN function to write data to a data file.


Writing Data to a File (defined)

Writing Data to a File

To send data from a worksheet to an external data file by connecting to the data file. If the data in the worksheet changes, the data automatically updates in the data file.


X and Y Data are Related Exponentially

If your x and y values are related by:

y = A*exp(k*x)

You can apply the slope and intercept functions to the log of your data values and make use of the fact that:

ln(y) = ln(A) + k*x

In which case:

A = exp(intercept(vx,ln(vy)) and k = slope(vx,ln(vy))

The resulting fit weighs the errors differently from a least-squares exponential fit but is usually a good approximation.


You are trying to use an array or range as a scalar.

You are trying to use an array or a range as a scalar. Press F1 for help.

You used a vector or ranged expression or another kind of expression where a scalar is required.


You interrupted calculation. To resume...

You interrupted calculation. To resume, click here and press "F9".

You pressed [Esc] to halt a calculation. To recalculate the marked equation, put the cursor in the equation and choose Calculate Þ Calculate Now from the Tools menu, or press [F9].

If you want to start resume calculation for the entire worksheet, choose Calculate Worksheet instead or press [Ctrl]F9.

If you find yourself frequently interrupting calculations to avoid having to wait to recalculate as you edit your worksheet, you may wish to switch to manual mode.


Z-Transform

To evaluate the z-transform transform of a function:

  1. Enter the expression to be transformed.

  2. Click on the transform variable.

  3. Choose Transform / z- from the Symbolics menu.

Mathcad returns a function in the variable z when you perform a z-transform. If the expression you are transforming already contains an z, Mathcad avoids ambiguity by returning a function in the variable zz instead. Use the Variable / Substitute command to substitute a different variable or expression for z.

Note:

When you use symbolic commands from the Symbolics menu, the symbolic processor does not “know” about any variable definitions in your worksheet. If you need that kind of live symbolic evaluation, use the "ztrans" keyword with live symbolic evaluation.

Launch QuickSheet Example


Zero factors or numerators

For efficiency reasons, Mathcad always assumes that for any expression x:

0*x=0

and

0/x = 0

Presented with a calculation of this type, Mathcad will not even evaluate x. This has the following consequences:

Mathcad instantly computes a result of zero for these expressions, even if x requires a time-consuming calculation like an integral or a summation.

If computing x would result in an error, Mathcad returns zero without detecting the error. In some cases this is desirable; in others it isn’t.

Mathcad evaluates 0/0 as zero, not as an error.


Zoom In

Magnifies a portion of your worksheet. You can zoom in twice.


Zoom Out

Cancels any magnification so that you see your document in the normal size used by Print Preview.


Zooming Cursor

Magnifies the portion of your worksheet over which it lies when you click the right mouse button. You can click twice to magnify your worksheet even more. Once you’re at the maximum magnification, clicking the zooming cursor de-magnifies your worksheet.


Zooming in on a 3D Plot

To zoom in on a 3D plot:

  1. Click in the plot.

  2. Hold down the CTRL key and click the mouse button down.

  3. Drag the mouse.

  4. Let go of the mouse when the amount of zoom is adequate.

To zoom in on a 3D plot by a specific amount:

  1. Click on the plot with the right mouse button.

  2. Choose Properties from the pop-up menu.

  3. Click on the General tab in the dialog box.

  4. Change the value in the Zoom text box.

Note:

If you use an IntelliMouse-compatible mouse with a center wheel, you can rotate the wheel to zoom in or out on a three-dimensional plot.


Zooming in on a Polar Plot

To magnify a portion of a plot:

  1. Click in the polar plot to select it, then choose Graph / Zoom from the Format menu to bring up the Zoom dialog box.

  2. In the plot region, press and hold down the mouse button. Drag the mouse until a dashed selection circle just encloses the region you want to magnify.

  3. Let go of the mouse button. The radius of the selected region is listed in the "Radius:" box of the Polar Zoom dialog box.

  4. Press the "Zoom" button to redisplay the plot. The axis limits are temporarily set to the coordinates specified in the Polar Zoom dialog box. To make these axis limits permanent, click "OK."

  5. Press "Unzoom" to restore the plot to its state before zooming. Press "Full View" to restore the original plot when you've zoomed in on a plot more than once.


Zooming in on an X-Y Plot

To magnify a portion of a plot:

  1. Click in the plot to select it.

  2. Choose Graph / Zoom from the Format menu to bring up the Zoom dialog box.

  3. In the plot region, press and hold down the mouse button at one corner of the region you want to magnify.

  4. Drag the mouse until a dashed selection rectangle encloses the region you want to magnify.

  5. Click "Zoom" to redisplay the plot.

When you click "Zoom," the axis limits are temporarily set to the coordinates specified in the Zoom dialog box. To make these axis limits permanent, click "OK."